Hi,
I have a field which contains epoch date and date time like %Y%m%d :
I want this format %Y%m%d for all values in "date" field.
How can I convert epoch to date like %Y%m%d in this field ?
Thanks !
I tried your solution and it gave me this :
20210201 = 22-08-1970 : there is a problem ...
I tried another command :
| convert timeformat="%Y-%m-%d" mktime("date")
and thant's worked ! All values in %Y-%m-%d format are converted to epoch time !
Thanks for your help !
hi @mah,
Try this:
| eval date=if(match(date, "\d{4}\-\d{2}\-\d{2}"), replace(date, "-", ""), strftime(date, "%Y%m%d"))
If this reply helps you, an upvote/like would be appreciated.
I tried your solution and it gave me this :
20210201 = 22-08-1970 : there is a problem ...
I tried another command :
| convert timeformat="%Y-%m-%d" mktime("date")
and thant's worked ! All values in %Y-%m-%d format are converted to epoch time !
Thanks for your help !
Did you wanted Date field values in "%Y%m%d" OR in epoch format?