1 1.4 rillig # $NetBSD: varmod-localtime.mk,v 1.4 2020/10/29 19:01:10 rillig Exp $ 2 1.1 rillig # 3 1.2 rillig # Tests for the :localtime variable modifier, which returns the given time, 4 1.2 rillig # formatted as a local timestamp. 5 1.1 rillig 6 1.4 rillig # Test for the default time format, %c. Since the time always varies, it's 7 1.4 rillig # only possible to check for the general format here. The names of the 8 1.4 rillig # month and weekday are always in English, independent from the locale. 9 1.4 rillig # Example: Thu Oct 29 18:56:41 2020 10 1.4 rillig .if ${:U:localtime:tW:M??? ??? ?? ??\:??\:?? ????} == "" 11 1.4 rillig . error 12 1.4 rillig .endif 13 1.4 rillig 14 1.1 rillig all: 15 1.3 rillig @echo ${%Y:L:localtim=1593536400} # modifier name too short 16 1.3 rillig @echo ${%Y:L:localtime=1593536400} # 2020-07-01T00:00:00Z 17 1.3 rillig @echo ${%Y:L:localtimer=1593536400} # modifier name too long 18