Splunk Search

Converting time

akawacz
Path Finder

Hi

How to convert below into readable format ?

41861.003287037
41855.001458333

I was trying this but did not work

strftime(strptime(Close"%m/%e/%Y %l:%M:%S %p"),"%Y-%m-%d %H:%M:%S")

Regards

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try something like this (assuming this is excel date )

strftime((Close-25569)*86400 ,"%Y-%m-%d %H:%M:%S")

View solution in original post

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try something like this (assuming this is excel date )

strftime((Close-25569)*86400 ,"%Y-%m-%d %H:%M:%S")
0 Karma

akawacz
Path Finder

Hi

It worked thank you. Could you explain my why we substract 25569 and multiply by 86400

Thank you

0 Karma

somesoni2
SplunkTrust
SplunkTrust

The base for excel date time is 1/1/1900 and for epoch is 1/1/1970, the 25569 is the adjustment of dates (for 70 years). Multiplication by 86400 is to convert days into seconds (excel shows in days, epoch in seconds)

0 Karma

akawacz
Path Finder

thank you so much

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What do those numbers represent? They certainly are not time strings in the format shown in your strptime command.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...