Getting Data In

How can I convert time 2016-09-12T10:16:51.000+00:00 with timezone specified in simple date and time (2016-09-12 10:16:51)format

isha_rastogi
Path Finder

I've been trying to convert "2016-09-12T10:16:51.000+00:00" into simple format i.e:
2016-09-12 10:16:51.
Tried using strptime and strftime
mysearch|eval _time=strptime(_time,"%Y-%m-%d%Z%T%c")| eval _time=strftime(_time,"%Y-%m-%d %H:%M") | timechart count
Any help will be appreciated.

0 Karma
1 Solution

sundareshr
Legend

Try this runanywhere sample.

| makeresults | eval x="2016-09-12T10:16:51.000+05:00" | eval y=strptime(x, "%Y-%m-%dT%H:%M:%S.%3N%z") | eval z=strftime(y, "%Y-%m-%d %H:%M:%S") | table x y z

View solution in original post

0 Karma

sundareshr
Legend

Try this runanywhere sample.

| makeresults | eval x="2016-09-12T10:16:51.000+05:00" | eval y=strptime(x, "%Y-%m-%dT%H:%M:%S.%3N%z") | eval z=strftime(y, "%Y-%m-%d %H:%M:%S") | table x y z
0 Karma

isha_rastogi
Path Finder

It Worked. Thanks 🙂

0 Karma
Get Updates on the Splunk Community!

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 ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...