Splunk Search

finding difference between two dates

renuka13
Explorer

hi,

how do i find the difference between two dates which are in the form 12-JAN-2003? How do i first convert months to decimal form? i tried using following command-
..|eval start_dt=strptime(START_DATE,"%d-%m-%Y")

its not giving any value. Please let me know how do i do the conversion and find the difference between 2 dates.

Tags (1)
0 Karma

kristian_kolb
Ultra Champion

%m refers to the month in numerical form, i.e. 01 in the case of January. %b is the abbreviated 'text' format, i.e. 'Jan'. For more information, see www.strftime.net

Also, it would probably be better to continue and edit your original question http://splunk-base.splunk.com/answers/79857/how-to-subtract-10-jan-2012-11-jan-2010

/K

0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...