This wiki is archived and useful information is being migrated to the main bzflag.org website

bz_getUTCtime

From BZFlagWiki
Jump to: navigation, search

void bz_getUTCtime (bz_Time *ts)


Fills a bz_Time object with values for the Universal Time Coordinated (UTC) time.

Parameters:
*ts  -  bz_Time object to fill.

Example[edit]

Get the UTC time and display it to the user upon joining.

case bz_ePlayerJoinEvent: {
	bz_Time currentTime;
	bz_getUTCtime(&currentTime);
	bz_sendTextMessagef(BZ_SERVER,((bz_PlayerJoinPartEventData_V1*)eventData)->playerID,"Welcome! The current date is %d/%d/%d at %d:%d:%d.",currentTime.month,currentTime.day,currentTime.year,currentTime.hour,currentTime.minute,currentTime.second);
}break;