Date Stored as number in postgre database

All,
I have a date stored in a postgre database that is stored as a number, but I am not sure about how to convert it back to a date using vb.net. For instance, 1203094800 = 2/15/2008.
Can someone show me how to convert this number back to a regular date using vb.net or a postgresql statement. This method that is used in the payroll software is very annoying, but I do not want to rewrite the whole program.
LVL 1
jpadkins49Asked:
Who is Participating?
 
jjardineConnect With a Mentor Commented:
This ironically works...

DateTime _date = new DateTime(1970,1,1).AddSeconds(1203094800);
0
 
earth man2Connect With a Mentor Commented:
select cast( 'epoch' as timestamp ) + 1203094800 * interval '1 second';
      ?column?      
---------------------
 2008-02-15 17:00:00
(1 row)
0
 
earth man2Commented:
going the other way using extract
SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '2001-02-16 20:38:40-08');
0
 
jpadkins49Author Commented:
Thanks for all the help. That solved my problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.