Search

( date->string ( date? date ) ( string? format-string ) ) string?
format-string
~~
a literal ~
~a
locale's abbreviated weekday name (Sun...Sat)
~A
locale's full weekday name (Sunday...Saturday)
~b
locale's abbreviate month name (Jan...Dec)
~B
locale's full month day (January...December)
~c
locale's date and time (e.g., "Fri Jul 14 20:28:42-0400 2000")
~d
day of month, zero padded (01...31)
~D
date (mm/dd/yy)
~e
day of month, blank padded ( 1...31)
~f
seconds+fractional seconds, using locale's decimal separator (e.g. 5.2).
~h
same as ~b
~H
hour, zero padded, 24-hour clock (00...23)
~I
hour, zero padded, 12-hour clock (01...12)
~j
day of year, zero padded
~k
hour, blank padded, 24-hour clock ( 0...23)
~l
hour, blank padded, 12-hour clock ( 1...12)
~m
month, zero padded (01...12)
~M
minute, zero padded (00...59)
~n
new line
~N
nanosecond, zero padded
~p
locale's AM or PM
~r
time, 12 hour clock, same as "~I:~M:~S ~p"
~s
number of full seconds since "the epoch" (in UTC)
~S
second, zero padded (00...60)
~t
horizontal tab
~T
time, 24 hour clock, same as "~H:~M:~S"
~U
week number of year with Sunday as first day of week (00...53)
~V
ISO 8601 week number of the year with Monday as first day of week (01..53)
~w
day of week (0...6)
~W
week number of year with Monday as first day of week (01...52)
~x
locale's date representation
~X
locale's time representation
~y
last two digits of year (00...99)
~Y
year
~z
time zone in RFC-822 style
~Z
symbol time zone (not-implemented)
~1
ISO-8601 year-month-day format
~2
ISO-8601 hour-minute-second-timezone format
~3
ISO-8601 hour-minute-second format
~4
ISO-8601 year-month-day-hour-minute-second-timezone format
~5
ISO-8601 year-month-day-hour-minute-second format
( format ( string? format-string ) obj ... ) string?
format-string
~a
The corresponding value is inserted into the string as if printed with display.
~s
The corresponding value is inserted into the string as if printed with write.
~%A
A newline is inserted.
~~
A tilde '~' is inserted.
( format ( string? format-string ) obj ... ) string?
format-string
~a
Mnemonic: Any. Action: (display obj) for humans. Consumes: yes
~s
Mnemonic: Slashified. Action: (write obj) for parsers. Consumes: yes
~w
Mnemonic: WriteCircular. Action: (write-with-shared-structure obj) like ~s, but handles recursive structures. Consumes: yes
~d
Mnemonic: Decimal. Action: the obj is a number which is output in decimal radix. Consumes: yes
~x
Mnemonic: heXadecimal. Action: the obj is a number which is output in hexdecimal radix. Consumes: yes
~o
Mnemonic: Octal. Action: the obj is a number which is output in octal radix. Consumes: yes
~b
Mnemonic: Binary. Action: the obj is a number which is output in binary radix. Consumes: yes
~c
Mnemonic: Character. Action: the single charater obj is output by write-char. Consumes: yes
~y
Mnemonic: Yuppify. Action: the list obj is pretty-printed to the output. Consumes: yes
~?
Mnemonic: Indirection. Action: the obj is another format-string and the following obj is a list of arguments; format is called recursively. Consumes: yes
~K
Mnemonic: Indirection. Action: the same as ~? for backward compatability with some existing implementations. Consumes: yes
~[w[,d]]F
Mnemonic: Fixed. Action: ~w,dF outputs a number with width w and d digits after the decimal; ~wF outputs a string or number with width w. Consumes: yes
~~
Mnemonic: Tilde. Action: output a tilde. Consumes: no
~t
Mnemonic: Tab. Action: output a tab character. Consumes: no
~%
Mnemonic: Newline. Action: output a newline character. Consumes: no
~&
Mnemonic: Freshline. Action: output a newline character if it is known that the previous output was not a newline. Consumes: no
~_
Mnemonic: Space. Action: a single space character is output. Consumes: no
~h
Mnemonic: Help. Action: outputs one line of call synopsis, one line of comment, and one line of synopsis for each format directive, starting with the directive (e.g. "~t"). Consumes: no
( format ( #f port ) ( string? format-string ) obj ... ) string?
format-string
~a
Mnemonic: Any. Action: (display obj) for humans. Consumes: yes
~s
Mnemonic: Slashified. Action: (write obj) for parsers. Consumes: yes
~w
Mnemonic: WriteCircular. Action: (write-with-shared-structure obj) like ~s, but handles recursive structures. Consumes: yes
~d
Mnemonic: Decimal. Action: the obj is a number which is output in decimal radix. Consumes: yes
~x
Mnemonic: heXadecimal. Action: the obj is a number which is output in hexdecimal radix. Consumes: yes
~o
Mnemonic: Octal. Action: the obj is a number which is output in octal radix. Consumes: yes
~b
Mnemonic: Binary. Action: the obj is a number which is output in binary radix. Consumes: yes
~c
Mnemonic: Character. Action: the single charater obj is output by write-char. Consumes: yes
~y
Mnemonic: Yuppify. Action: the list obj is pretty-printed to the output. Consumes: yes
~?
Mnemonic: Indirection. Action: the obj is another format-string and the following obj is a list of arguments; format is called recursively. Consumes: yes
~K
Mnemonic: Indirection. Action: the same as ~? for backward compatability with some existing implementations. Consumes: yes
~[w[,d]]F
Mnemonic: Fixed. Action: ~w,dF outputs a number with width w and d digits after the decimal; ~wF outputs a string or number with width w. Consumes: yes
~~
Mnemonic: Tilde. Action: output a tilde. Consumes: no
~t
Mnemonic: Tab. Action: output a tab character. Consumes: no
~%
Mnemonic: Newline. Action: output a newline character. Consumes: no
~&
Mnemonic: Freshline. Action: output a newline character if it is known that the previous output was not a newline. Consumes: no
~_
Mnemonic: Space. Action: a single space character is output. Consumes: no
~h
Mnemonic: Help. Action: outputs one line of call synopsis, one line of comment, and one line of synopsis for each format directive, starting with the directive (e.g. "~t"). Consumes: no
( string-append-ec qualifier ... expression ) string?
Fragments' format
⟨qualifier⟩: 
generator ( if test ) ( not test ) ( and test ... ) ( or test ... ) ( begin command ... expression ) ( nested qualifier ... )
Fragments' types
( generator-macro generator )
( string? expression )