Unix Date Conversion

L

Lynn

I have a ModifyDate field in a table that is in Unix Date
format. When I run my query, I would like this date
format changed to mm/dd/yy so that it clearly shows the
modify date. Does anyone know how to convert the Unix
date to mm/dd/yy format.

Thank you in advance.
 
A

Allen Browne

By Unix date, I'm not sure if you mean a Julian date or a text
representation of yyyymmdd.

The solution will probably involve Mid() and DateSerial(), e.g.:
DateSerial(Left([UnixDate], 4), Mid([UnixDate], 5,2), Right([UnixDate], 2)
 
A

Allen Browne

DateAdd("s", [HowMany], #1/1/1970#)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to the newsgroup. (Email address has spurious "_SpamTrap")

Lynn said:
-----Original Message-----
By Unix date, I'm not sure if you mean a Julian date or a text
representation of yyyymmdd.

The solution will probably involve Mid() and DateSerial (), e.g.:
DateSerial(Left([UnixDate], 4), Mid([UnixDate], 5,2), Right([UnixDate], 2)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to the newsgroup. (Email address has spurious "_SpamTrap")

Lynn said:
I have a ModifyDate field in a table that is in Unix Date
format. When I run my query, I would like this date
format changed to mm/dd/yy so that it clearly shows the
modify date. Does anyone know how to convert the Unix
date to mm/dd/yy format.

Thank you in advance.


.
The Unix date is in seconds since the epoch (1/1/1970
00:00:00). So I've got a number in seconds, that I need
to convert a readable date format.
 
L

Lynn

Thank you, thank you, thank you! I forgot the # signs
when I tried it on my own.
-----Original Message-----
DateAdd("s", [HowMany], #1/1/1970#)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to the newsgroup. (Email address has spurious "_SpamTrap")

Lynn said:
-----Original Message-----
By Unix date, I'm not sure if you mean a Julian date
or a
text
representation of yyyymmdd.

The solution will probably involve Mid() and DateSerial (), e.g.:
DateSerial(Left([UnixDate], 4), Mid([UnixDate], 5,2), Right([UnixDate], 2)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")

I have a ModifyDate field in a table that is in Unix Date
format. When I run my query, I would like this date
format changed to mm/dd/yy so that it clearly shows the
modify date. Does anyone know how to convert the Unix
date to mm/dd/yy format.

Thank you in advance.


.
The Unix date is in seconds since the epoch (1/1/1970
00:00:00). So I've got a number in seconds, that I need
to convert a readable date format.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top