From: Dmitriy Antonov on

"briana" <briana(a)att.net> wrote in message
news:1161273048.073566.315860(a)m7g2000cwm.googlegroups.com...
> Well, I found the answer. To get the current time in EPOCH format, or
> TIME_T, if you prefer, it's just:
>
> DIM E_Time as String
> E_Time = DATEADD("s","1/1/1970",NOW)
>
> This does is only as close as the nearest second, so you may have to
> pad with zeros to get the string to the proper length.
>
> Brian A
>

Are you sure? The second param of the DateAdd function is a number and not a
string or a date. So your statement may work (in fact, it gave me an error
until I replaced double quotas with pound sign), but, in fact it is
equivalent to the following:

? DATEADD("s", CDbl(#1/1/1970#), NOW)

or, which is the same,

?DATEADD("s", 25569, NOW)

So if EPOCH format (which I have no idea what it is) is just a time, which
is 25569 seconds greater than local time, then it does, what you need,
otherwise - check the correctness of the algorithm.

Dmitriy.


From: Bob Butler on
"Dmitriy Antonov" <no(a)no.com> wrote in message
news:eH41v%2378GHA.4632(a)TK2MSFTNGP02.phx.gbl
> "briana" <briana(a)att.net> wrote in message
> news:1161273048.073566.315860(a)m7g2000cwm.googlegroups.com...
>> Well, I found the answer. To get the current time in EPOCH format,
>> or TIME_T, if you prefer, it's just:
>>
>> DIM E_Time as String
>> E_Time = DATEADD("s","1/1/1970",NOW)
>>
>> This does is only as close as the nearest second, so you may have to
>> pad with zeros to get the string to the proper length.
>>
>> Brian A
>>
>
> Are you sure? The second param of the DateAdd function is a number
> and not a string or a date. So your statement may work (in fact, it
> gave me an error until I replaced double quotas with pound sign),
> but, in fact it is equivalent to the following:
>
> ? DATEADD("s", CDbl(#1/1/1970#), NOW)
>
> or, which is the same,
>
> ?DATEADD("s", 25569, NOW)
>
> So if EPOCH format (which I have no idea what it is) is just a time,
> which is 25569 seconds greater than local time, then it does, what
> you need, otherwise - check the correctness of the algorithm.

LOL, didn't even see DateAdd instead of DateDiff there!

--
Reply to the group so all can participate
VB.Net: "Fool me once..."

From: Dmitriy Antonov on

"Bob Butler" <tiredofit(a)nospam.ever> wrote in message
news:%23Mle7f88GHA.4996(a)TK2MSFTNGP03.phx.gbl...
> "Dmitriy Antonov" <no(a)no.com> wrote in message
> news:eH41v%2378GHA.4632(a)TK2MSFTNGP02.phx.gbl
>> "briana" <briana(a)att.net> wrote in message
>> news:1161273048.073566.315860(a)m7g2000cwm.googlegroups.com...
>>> Well, I found the answer. To get the current time in EPOCH format,
>>> or TIME_T, if you prefer, it's just:
>>>
>>> DIM E_Time as String
>>> E_Time = DATEADD("s","1/1/1970",NOW)
>>>
>>> This does is only as close as the nearest second, so you may have to
>>> pad with zeros to get the string to the proper length.
>>>
>>> Brian A
>>>
>>
>> Are you sure? The second param of the DateAdd function is a number
>> and not a string or a date. So your statement may work (in fact, it
>> gave me an error until I replaced double quotas with pound sign),
>> but, in fact it is equivalent to the following:
>>
>> ? DATEADD("s", CDbl(#1/1/1970#), NOW)
>>
>> or, which is the same,
>>
>> ?DATEADD("s", 25569, NOW)
>>
>> So if EPOCH format (which I have no idea what it is) is just a time,
>> which is 25569 seconds greater than local time, then it does, what
>> you need, otherwise - check the correctness of the algorithm.
>
> LOL, didn't even see DateAdd instead of DateDiff there!
>
> --
> Reply to the group so all can participate
> VB.Net: "Fool me once..."
>

Does it mean that that EPOCH's presentation of time is a number of seconds
elapsed since January 1, 1970? If yes, then OP just need to replace DateAdd
with DateDiff (and quotation marks with pound signs).

Dmitriy.


From: Bob Butler on
"Dmitriy Antonov" <no(a)no.com> wrote in message
news:eWFeF188GHA.3740(a)TK2MSFTNGP05.phx.gbl
> Does it mean that that EPOCH's presentation of time is a number of
> seconds elapsed since January 1, 1970? If yes, then OP just need to
> replace DateAdd with DateDiff (and quotation marks with pound signs).

Don't know what "EPOCH" refers to; number of seconds since 1/1/1970 is used
commonly to represent time

--
Reply to the group so all can participate
VB.Net: "Fool me once..."

From: MP on
"Bob Butler" <tiredofit(a)nospam.ever> wrote in message
news:O1Toj888GHA.4740(a)TK2MSFTNGP02.phx.gbl...
> "Dmitriy Antonov" <no(a)no.com> wrote in message
> news:eWFeF188GHA.3740(a)TK2MSFTNGP05.phx.gbl
> > Does it mean that that EPOCH's presentation of time is a number of
> > seconds elapsed since January 1, 1970? If yes, then OP just need to
> > replace DateAdd with DateDiff (and quotation marks with pound signs).
>
> Don't know what "EPOCH" refers to; number of seconds since 1/1/1970 is
used
> commonly to represent time
>

I thought Epoch was number of seconds elapsed since BIG_BANG
:-)