spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * DateTime functions and properties

Now property

(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


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.