Refine your search:

Hey everyone, I am trying to convert two different date fields into unix time to do some mathematical operations. One of my timestamps doesn't want to convert for some reason. Here it is: 20110527162327.013

The time format is YYYYMMDDHHmmss.sss.

I pass it into convert like so:

convert timeformat="%Y%m%d%H%M%S.%q" mktime(AS_Start_Time)

But it still outputs the exact same input time. Anyone have any ideas?

asked 31 May '11, 14:01

msarro's gravatar image

msarro
5673437
accept rate: 75%


One Answer:

I suppose it's a bug, but convert...mktime() is probably deprecated at this point in favor of eval...strptime():

eval AS_Start_Time=strptime(AS_Start_Time,"%Y%m%d%H%M%S.%q")
link

answered 01 Jun '11, 00:09

gkanapathy's gravatar image

gkanapathy ♦
32.3k4827
accept rate: 41%

The documentation for version 4.2.1 does not show convert as deprecated. Just curious if you're going by best practices or is the function in fact deprecated and the documentation doesn't reflect that?

(01 Jun '11, 07:49) msarro
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×53

Asked: 31 May '11, 14:01

Seen: 708 times

Last updated: 01 Jun '11, 07:49

Copyright © 2005-2012 Splunk Inc. All rights reserved.