How to does SMF store date ?

Started by NoobDeveloper, November 16, 2015, 12:48:35 AM

Previous topic - Next topic

NoobDeveloper

I am developing a bot in C# for some reason and i am able to auto post to my forum. The only thing i am not able to figure out is how SMF stores date.

I checked database and found date values like 1447441726

Given todays date, say 16, Nov 2015, How can i convert this date in above format ?

I don't need PHP code , i just need the logic SMF uses so that i can write same in C#.

Gluz

SMF uses Unix TimeStamp to register the date values.

Unix Time is the number of seconds from the Unix Epoch, that is January 1st, 1970 at UTC.

I don't know C#, but there should be a function to transform Unix TimeStamp to readable form and vice versa.

PHP uses it directly the function time() to save the post time when submited, that gives the Unix TimeStamp as a result, also the date() function is used to convert the Unix TimeStamp to a readable specified form.

Advertisement: