Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
VB Programming

Tutorial: Calendar

 

We can create date/time values using the Calendar class.

1. Create a date and change it


Big

We represent the date 20th May 1962 and print it.

We add 40 days to the date and print again.

Notes

Calendar.JANUARY is 0 rather than 1 as you might expect.

We can also add Calendar.DAY_OF_MONTH Calendar.MONTH Calendar.YEAR

In printf we can use the codes:
%td day of month (two digit)
%tm month of year (two digit)
%tY year (four digit)
%ta day of week (three characters)