what is the best way to convert a formatted time to a unix epoch

R

rabbits77

x-no-archive: yes

What is the best way to convert a formatted time to a
unix "time since epoch"?
So, I have a string like
2009-02-3 21:31:29
and I want that converted to the number of milliseconds since the unix
epoch. What is the best way to do this?
 
J

Jürgen Exner

rabbits77 said:
I left out part of the data.
I really have a string like this
2009-02-3 21:31:29,777
Anyway, its a shame you wanted to be a **** instead of just answer the
question...

If you deliberately withhold important information then you shouldn't be
surprised if you get solutions for a different problem.

Garbage in - garbage out.
I already got a helpful answer earlier in the thread. Time::Local does
the trick.

Guess what, Time::Local is mentioned in the FAQ answer that I pointed
out. Did you read it?

jue
 
G

Gunnar Hjalmarsson

Jürgen Exner said:
See "perldoc -q epoch":
How can I take a string and turn it into epoch seconds?


You don't. Your input data only has a resolution of seconds. There is no
point in computing the output to milliseconds and pretending to have a
resolution that is three orders of magnitude higher than your input
provides.

Hey guys (Jürgen, Tad, Sinan), give it a break, please.

I had already answered the question, as well as questioned the seemingly
contradictory millisecond requirement, and the OP had explained the latter.

This whole sub-thread appears to be totally unnecessary, and only serves
the purpose of adding to the high noise level of this group.
 
J

Jürgen Exner

Gunnar Hjalmarsson said:
Hey guys (Jürgen, Tad, Sinan), give it a break, please.

I had already answered the question, as well as questioned the seemingly
contradictory millisecond requirement, and the OP had explained the latter.

This whole sub-thread appears to be totally unnecessary, and only serves
the purpose of adding to the high noise level of this group.

Fair enough. But I do take objection to the implication of "already" in
your first sentence. According to the time stamps you are right. But at
the time I wrote and sent my answer your reply had not arrived at my
client yet and therefore was not visible to me.
That's why I wrote my reply in the first place: there was no other reply
yet.

jue
 
R

rabbits77

x-no-archive: yes
Why did you (attempt to) ask for no archiving of your post?

No, this will actually work. With Google anyway. Since many users are
simply not allowed by their clients to modify headers Google will honor
the x-no-archive if it is the first line of a post.
Speaking of Google, maybe you should use it before typing.
If it is archived, then others seeking an answer to the same
question would be able to find it.

How uncharacteristically altruistic of you. Typically your posts are
socially retarded rants on grammar and semantics.
Are you back on your meds?
 
T

Tim Greer

rabbits77 said:
Speaking of Google, maybe you should use it before typing.

I don't think many people care what provider you use, but I don't think
suggesting people give up a real news client and using google groups
will win anyone over. :)
 
R

rabbits77

x-no-archive: yes

Tim said:
I don't think many people care what provider you use, but I don't think
suggesting people give up a real news client and using google groups
will win anyone over. :)
I will charitably assume you are not being intentionally obtuse...
My suggestion was that he use Google to check his (invalid) conjecture
that adding x-no-archive to the first line of a post does not matter.
If you had simply looked at the headers of my post you would see that I
do not use Google Groups to post.
 
T

Tim Greer

rabbits77 said:
x-no-archive: yes
I will charitably assume you are not being intentionally obtuse...
My suggestion was that he use Google to check his (invalid) conjecture
that adding x-no-archive to the first line of a post does not matter.
If you had simply looked at the headers of my post you would see that
I do not use Google Groups to post.

I really don't care, but when you said "Speaking of Google, maybe you
should use it before typing.", it sure sounded like you meant he should
try Google groups, rather than "verify it won't archive". You using
Google groups has no bearing on what I thought you meant. I was
mistaken about what you had meant, and you've cleared it up. Not a big
deal.
 
U

Uri Guttman

r> No, this will actually work. With Google anyway. Since many users are
r> simply not allowed by their clients to modify headers Google will honor
r> the x-no-archive if it is the first line of a post.
r> Speaking of Google, maybe you should use it before typing.

r> How uncharacteristically altruistic of you. Typically your posts are
r> socially retarded rants on grammar and semantics.
r> Are you back on your meds?

and you don't show attributions for whom you are insulting. seems kinda
dumbass as well. pot meet kettle. and don't flame me back as i have
dragon scale armor on.

uri
 
T

TheGist

Uri said:
r> No, this will actually work. With Google anyway. Since many users are
r> simply not allowed by their clients to modify headers Google will honor
r> the x-no-archive if it is the first line of a post.
r> Speaking of Google, maybe you should use it before typing.


r> How uncharacteristically altruistic of you. Typically your posts are
r> socially retarded rants on grammar and semantics.
r> Are you back on your meds?

and you don't show attributions for whom you are insulting. seems kinda
dumbass as well. pot meet kettle. and don't flame me back as i have
dragon scale armor on.
They actually make that in your size?
How many dragons did that take?
 
G

Gunnar Hjalmarsson

Jürgen Exner said:
Fair enough. But I do take objection to the implication of "already" in
your first sentence. According to the time stamps you are right. But at
the time I wrote and sent my answer your reply had not arrived at my
client yet and therefore was not visible to me.
That's why I wrote my reply in the first place: there was no other reply
yet.

Yeah, I know that questions get answered multiple times for that reason,
and the OP is certainly not guiltless of the mess. It's still a mess IMO. :(
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top