Date format: Difference between revisions

no edit summary
(Added Arturo implementation)
No edit summary
Line 1,105:
= A$</lang>
 
=={{header|Beads}}==
<pre>
// time_to_str(format, time, city, lang)
// format directives:
// [sun] - abbreviated weekday, e.g. Sun
// [sunday] - full weekday name, e.g. Sunday
// [jan] - abbrev month
// [january] - full month
// [day] - day of the month 1, 2, ..31
// [day2] - day of the month as two digits 01, 02, ..31
// [hour] - hour 00, 01, 03..23
// [hour12] - hour 1..12
// [julian] - day of the year 1..366
// [month] - month 1..12
// [month2] - month as two digits 01, 02, ..12
// [minute] - Minute 00, 01, 02..59
// [am] - AM or PM
// [sec] - second 00, 01, 02..61
// [msec] - millisecond 000...999
// [week sun] - week number of the year, sunday based (ranges 01-53, per ISO spec)
// [week mon] - week number of the year, monday based
// [year] - year with century 2024
// [year2] - year without century 00, 01, ..99
// [date] - default date format (e.g. Jan 14, 2015 )
// [date time] - (e.g. Jan 14, 2015 3:45 PM)
// [iso date] = [year]-[month2]-[day2], e.g. 2015-02-22
// [iso time] = [hour]:[minute]:[second], e.g. 18:06:05
</pre>
<lang beads>beads 1 program 'Date format'
 
calc main_init
log time_to_str('[iso date]')
log time_to_str('[sunday], [january] [day2], [year]')</lang>
 
{{out}}
<pre>
2021-03-11
Thursday, March 11, 2021
</pre>
=={{header|C}}==
<lang c>#include <stdlib.h>
Anonymous user