- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Marco_Develops
Path Finder
04-08-2022
09:05 AM
Currently I have a field holding a Julian date. I am trying to convert it using strftime but i'm having issues.
Date = 2022.091
Current query:
index = * | eval ConvertedDate = strftime(DATE,"%Y.%j")| table ConvertedDate
Ideally I would like to get an output like 04/03/2022
Thank you,
Marco
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![richgalloway richgalloway](https://community.splunk.com/legacyfs/online/avatars/140500.jpg)
richgalloway
![SplunkTrust SplunkTrust](/html/@E48BE65924041B382F8C3220FF058B38/rank_icons/splunk-trust-16.png)
SplunkTrust
04-08-2022
10:06 AM
The strftime function converts an epoch timestamp (integer) into a human-readable string. Use the strptime function to convert a datetime string into epoch form.
index = *
| eval ConvertedDate = strftime(strptime(DATE,"%Y.%j"), "%m/%d/%Y")
| table ConvertedDate
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![richgalloway richgalloway](https://community.splunk.com/legacyfs/online/avatars/140500.jpg)
richgalloway
![SplunkTrust SplunkTrust](/html/@E48BE65924041B382F8C3220FF058B38/rank_icons/splunk-trust-16.png)
SplunkTrust
04-08-2022
10:06 AM
The strftime function converts an epoch timestamp (integer) into a human-readable string. Use the strptime function to convert a datetime string into epoch form.
index = *
| eval ConvertedDate = strftime(strptime(DATE,"%Y.%j"), "%m/%d/%Y")
| table ConvertedDate
---
If this reply helps you, Karma would be appreciated.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Marco_Develops
Path Finder
04-08-2022
10:31 AM
@richgalloway This worked. Thank you for your time and explanation .
-Marco
![](/skins/images/FE4825B2128CA5F641629E007E333890/responsive_peak/images/icon_anonymous_message.png)