Update time.dm
This commit is contained in:
@@ -1,57 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
//Returns the world time in english
|
||||
/proc/worldtime2text()
|
||||
return gameTimestamp("hh:mm:ss", world.time)
|
||||
|
||||
/proc/time_stamp(format = "hh:mm:ss", show_ds)
|
||||
var/time_string = time2text(world.timeofday, format)
|
||||
return show_ds ? "[time_string]:[world.timeofday % 10]" : time_string
|
||||
|
||||
/proc/gameTimestamp(format = "hh:mm:ss", wtime=null)
|
||||
if(!wtime)
|
||||
wtime = world.time
|
||||
return time2text(wtime - GLOB.timezoneOffset + SSticker.gametime_offset - SSticker.round_start_time, format)
|
||||
|
||||
/* Returns 1 if it is the selected month and day */
|
||||
/proc/isDay(month, day)
|
||||
if(isnum(month) && isnum(day))
|
||||
var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month
|
||||
var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day
|
||||
if(month == MM && day == DD)
|
||||
return 1
|
||||
|
||||
// Uncomment this out when debugging!
|
||||
//else
|
||||
//return 1
|
||||
|
||||
//returns timestamp in a sql and ISO 8601 friendly format
|
||||
/proc/SQLtime(timevar)
|
||||
if(!timevar)
|
||||
timevar = world.realtime
|
||||
return time2text(timevar, "YYYY-MM-DD hh:mm:ss")
|
||||
|
||||
|
||||
GLOBAL_VAR_INIT(midnight_rollovers, 0)
|
||||
GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
|
||||
/proc/update_midnight_rollover()
|
||||
if (world.timeofday < GLOB.rollovercheck_last_timeofday) //TIME IS GOING BACKWARDS!
|
||||
return GLOB.midnight_rollovers++
|
||||
return GLOB.midnight_rollovers
|
||||
|
||||
/proc/weekdayofthemonth()
|
||||
var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day
|
||||
switch(DD)
|
||||
if(8 to 13)
|
||||
return 2
|
||||
if(14 to 20)
|
||||
return 3
|
||||
if(21 to 27)
|
||||
return 4
|
||||
if(28 to INFINITY)
|
||||
return 5
|
||||
else
|
||||
return 1
|
||||
=======
|
||||
//Returns the world time in english
|
||||
/proc/worldtime2text()
|
||||
return gameTimestamp("hh:mm:ss", world.time)
|
||||
@@ -200,4 +146,3 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
|
||||
day = "1 day"
|
||||
|
||||
return "[day][hour][minute][second]"
|
||||
>>>>>>> 74f5a8c... DisplayTimeText mk2 (#30969)
|
||||
|
||||
Reference in New Issue
Block a user