Convert date (c#) -


good day! faced problem. need convert date. in database stored in format:

1332622254 1332622368 1332622467 1332622551 

i format never encountered. format, not know. format in vfeueshu. in advance.

it's time in seconds since midnight 1-1-1970:

var epoch = new datetime(1970,1,1); var ts = timespan.fromseconds(1332622254); var date = epoch.add(ts); 

date 24-3-2012 20:50:54

edit
or simpler, marcinjuraszek rightly stated:

var epoch = new datetime(1970,1,1); var date = epoch.addseconds(1332622254); 

note might date/time in utc, maybe have adjust timezone.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -