Hot spot and the time

Started by Candle, Mon 03/10/2005 18:18:16

Previous topic - Next topic

Candle

How would you do a hotspot when clicked it gives the time in a massage?( the users computer clock time)

Ashen

DateTime.Now:
Quote from: The Manual
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
I know what you're thinking ... Don't think that.

Candle

Thank you , just what I wanted to do.

SMF spam blocked by CleanTalk