Strategy game with hit-and-run attacks that requires very quickly placed offensives and support. Some attacks may only be a few hundred milliseconds apart, so defending between attacks requires you to know exactly when they hit / when support arrives.
I forgot all about BYOND having SQL built-in now. My apologies and thank you Taitz for taking over :)
In response to Ssj4justdale
Was my pleasure to be of help.
Just realized, still having a slight problem with this. I am getting a time, but it has nothing to do with the system time, it's in another timezone. So I tried to add a timezone set (to system default):

roc/Get_Timestamp()
var
database
db=new("test.db")
query
ts=new(" select date_default_timezone_set('system_time_zone') ")
q=new(" select strftime('%Y:%m:%d:%H:%M:%f', 'now')")
if(!ts.Execute(db))return
if(!q.Execute(db))return
while(q.NextRow())
var/row[]=q.GetRowData()
for(var/i in row)
return row[i]

(Current proc)

However, that has broken the entire thing to return null every time now. (I know nothing of SQLite ;-;)

How would I set the timezone? Do I need a second query object or can it be done in the main object?
What timezone do you want to get the date out in, UTC?
Preferably the time zone that the server is hosted in, or if that isn't possible to figure out, from a variable so it can be selected by the server host at set-up.
select strftime('%Y:%m:%d:%H:%M:%f', 'now', 'localtime')

Although I'd argue that if you're using this for accurate internal time and need millisecond accuracy, it shouldn't matter if it's in UTC or localtime, and you'd maybe want a timestamp also.

It seems like Taitz already had the localtime bit in for you, but you lost it along the way?
While I am using it for millisecond accuracy, the values will be shown to the players in certain places - so if the server host is playing, it will be shown in their timezone (and for every other player not in the same zone, that timezone will be called 'server time' so they would have to coordinate around that time for them.)

Not sure why this is happening however:

2014:05:20:10:50:05.262

It's 1 hour and 10 minutes off my local time now, which is closer than before. The hourly delay might be caused by DST settings, but the 10 minute delay is throwing me off, I have no clue what the 10 minutes might be for..
I'd be inclined to check your system clock, BIOS clock etc. Over here, it happily returns local time, with BST (GMT +1, summer time) included.
System clock and bios clock are the same values (checked) plus it's doing this on more than one of my computers. :u

So far working around it by adding 4200 seconds to the Timestamp object itself (Which is where I have the processing code, output and such) which brings it to the correct time, but it would be nice to know why this is occurring o.O
Page: 1 2