Skip to main content
sameeru0003
January 23, 2025
Question

Convert Text to DateandTime

  • January 23, 2025
  • 24 replies
  • 0 views

Hi Team,

I have below text and I want to convert it into a Date and Time.

Example:

Text:  "01/07/2025 12:00:35 PM"

Date and Time: 01/07/2025 12:00:35 PM or 01/07/2025 12:00:35 PM GMT+00:00

24 replies

stefanhelzle0001
January 23, 2025
sameeru0003
January 23, 2025

Not able to get the desired output if i use only todatetime(). I think need to use more functions to get the exact value i am specifying.

stefanhelzle0001
January 23, 2025

What is the desired output? Are you missing the seconds?

jayaprakashr0001
January 23, 2025
Text:  "01/07/2025 12:00:35 PM"

Can you specify in which format it is dd/mm/yyyy or mm/dd/yyyy if it is mm/dd/yyyy then you can use the datetime() function else you need to split and convert to datetimeformat.

sameeru0003
January 23, 2025

Its mm/dd/yyyy

jayaprakashr0001
January 23, 2025

Can you share the code as you are using split() it returns a list. So for the datetime field try indexing the output of the split data.