(Formerly known as GetTime, which is now obsolete)
readonly static DateTime* DateTime.Now;
Gets the current system time.
You could use this for timing a loop, or for effects like telling the
player to go to bed, and so on.
A DateTime object is returned, which contains various properties that you can use.
Note that the DateTime object that you get will not be kept up to date with the current time;
it will remain static with the time at which you called DateTime.Now.
Example:
DateTime *dt = DateTime.Now;
Display("The date is: %02d/%02d/%04d", dt.DayOfMonth, dt.Month, dt.Year);
Display("The time is: %02d:%02d:%02d", dt.Hour, dt.Minute, dt.Second);
will display the current date and time in 24-hour format
See Also: DateTime.DayOfMonth,
DateTime.Hour,
DateTime.Minute,
DateTime.Month,
DateTime.RawTime,
DateTime.Second,
DateTime.Year
|