Splunk Search

Change time format

TheBravoSierra
Explorer

I have a field called "Completed_On" in time format: 12/23/2020 14:16:51.

I'd like to remove the hours, minutes, and seconds so it just displays 12/23/2020. 

How can I do this? 

Labels (2)
0 Karma
1 Solution

alonsocaio
Contributor

HI @TheBravoSierra 

You can try using the strftime function:

| eval Completed_On_New = strftime(Completed_On, "%m/%d/%Y")

View solution in original post

scelikok
Champion

Hi @TheBravoSierra,

Try below;

| eval Completed_On=mvindex(split(Completed_On," "),0)

 

If this reply helps you an upvote is appreciated.

If this reply helps you an upvote is appreciated.

alonsocaio
Contributor

HI @TheBravoSierra 

You can try using the strftime function:

| eval Completed_On_New = strftime(Completed_On, "%m/%d/%Y")

View solution in original post