Forum Discussion
Formatting date text string to a custom format
- 3 years ago
Do you need something like this? This formula uses the UTCNOW() function to get the current UTC time and the FORMAT function to format the datetime in the desired format. You can replace UTCNOW() function with the column you have.
Column = CONCATENATE( FORMAT(UTCNOW(), "yyyy-MM-ddT"), SUBSTITUTE( FORMAT(UTCNOW(), "HH:mm:ss.fffZ"), ":", "%3A" ) )
Sure! So after T should be the hour, then minutes, then seconds, as for html, apparently time is written like that, with %3A being the substitute for ":" I hope this helps.
is 000Z a fixed ending?
- Amazing_Random3 years agoHelper I
Yes it is the Timezone I believe
Ok I formatted the date to:
2023-01-10T17:30:00
However, the timezones are different, the URL is using England's Time Zone (GMT) and I'm in (GMT+13), I also have to add the '.000Z' at the end, which should be the GMT timezone code in url- ryan_mayu3 years agoSuper User
pls check if this is what you want
Column 2 = VAR _y=mid('Table'[column],7,4) VAR _m=mid('Table'[column],4,2) VAR _d=left('Table'[column],2) VAR _a=find(":",'Table'[column],1) VAR _h=if(right('Table'[column],2)="pm", mid('Table'[column],12,_a-12)+12,"0"&mid('Table'[column],12,_a-12)) VAR _min=left(right('Table'[column],7),2) VAR _s=left(right('Table'[column],4),2) return _y&"-"&_m&"-"&_d&"T"&_h&"%3A"&_min&"%3A"&_s&".000Z"- Amazing_Random3 years agoHelper I
It says
"The search Text provided to function 'FIND' could not be found in the given text"