Re: How do I convert a date to unix-format by Jonathan
Jonathan
Mon Jun 28 17:56:38 CDT 2004
"Soren" <sbcxp@msn.com> wrote in message
news:2282b01c45d5e$f28e2f50$a101280a@phx.gbl...
> Hi
>
> I need a VBA function to convert a date (e.g. 06-28-2004)
> to UNIX-format (e.g. 1088433541)
>
> Can anyone help me?
The Unix date format is the number of seconds since 1/1/1970. On that basis,
this should give you the correct value
Function UnixDate(d As Date) As Long
UnixDate = DateDiff("s", #1/1/1970#, d)
End Function
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup