# ascii-time(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

ascii-time - Return the current time as a string

## SYNOPSIS

ascii-time

## DESCRIPTION

ascii-time returns the current time as a formatted string in `#p9` which is equivalent to `#l9` for the calling macro. The format of the resultant string is determined by the variable .ascii-time.format which is defined using the following escape characters:

`%%` - `%` char
`%Y` - 4 digit year
`%y` - 2 digit year
`%B` - Full month word
`%b` - 3 letter month
`%m` - 2 digit month
`%#m` - 1 digit month
`%d` - 2 digit day
`%#d` - 1 digit day
`%A` - Fill Week day word
`%a` - 3 letter week day
`%H` - 2 digit 24 hour
`%M` - 2 digit minute
`%S` - 2 digit second

The default value of .ascii-time.format when not defined is:

"`%a %b %d %H:%M:%S %Y`"

To change the default date layout then .ascii-time.format should be defined in user.emf. i.e.

    set-variable .ascii-time.format "%H:%M:%S %Y-%m-%d"

## EXAMPLE

The following is taken from etfinsrt.emf, it uses ascii-time in replacing "`$ASCII_TIME$`" with the current.

    0 define-macro etfinsrt
        .
        .
        ; Change the create date $ASCII_TIME$.
        beginning-of-buffer
        ; Get ASCII time in #l9
        ascii-time
        !force replace-string "\\$ASCII_TIME\\$" #l9
        .
        .
    !emacro

## NOTES

ascii-time is a macro defined in `utils.emf`.

## SEE ALSO

$buffer-fhook(5), etfinsrt(3), &find(4).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>