String to Datetime

I have the following example of string:

2022-11-21 05:00

When i apply parseDate(string, “YYYY-MM-DD HH:mm:ss”), I am getting this error (img):

Why is this? any workaround?

I even tried changing string to 2022-11-21 05:00:00 and same error

1 Like

Try this method instead:

  • Edit Dataset
  • Click on the data type
  • Change data type to Date
  • Save

Screenshot from 2022-11-29 08-55-19
Screenshot from 2022-11-29 08-55-48

This is a calculated field and not in the dataset originally

The same thing has happened to me when using parseDate. You need to make sure that every data point that you are converting to a date is of the right format. I believe that if you are trying to convert a field that has nulls for example, it won’t work. Make sure that everything is on the same format that you are describing (“YYYY-MM-DD HH:mm:ss”)

1 Like

Good call! Ill check for nulls and see if thats the case!

1 Like