Extract the Year, Month, WW, Day, Hour, minute and second in datetime

Hi there

How do you extract the year, month, WW, day, hour, minutes and second datetime value? Example [TIMESTAMP] = 3/5/2025 17:32:41 then the extract value in column [CODE] = 202531051732

0 2 71
2 REPLIES 2

mine i use this 
[CODE] = 
CONCATENATE(
YEAR([TIMESTAMP]),
TEXT(MONTH([TIMESTAMP]), "00"),
TEXT(DAY([TIMESTAMP]), "00"),
TEXT(HOUR([TIMESTAMP]), "00"),
TEXT(MINUTE([TIMESTAMP]), "00")
)
Hope it helps

Please try 

SUBSTITUTE(TEXT([TIMESTAMP],"YYYYMMWWHHMMSS"), "WW",RIGHT(0&(ISOWEEKNUM([TIMESTAMP])- ISOWEEKNUM(EOMONTH([TIMESTAMP],-1))),2))

Assumes 

1. [TIMESTAMP] is a datetime type column.

2. The week number is ISO week number and is rendered in two digits for uniformity purpose. So week number 1 is rendered as 01 

Please test well for your requirements by testing it on several dates as week number calculation can always be tricky, depending on what is the definition of a week -starting day of the week etc.

if you wish any fine tuning to week calculation, please mention what is your week definition-which day is the first day of the week. AppSheet expression WEEKDAY() considers Sunday as first day of the week.

Top Labels in this Space