Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object Time Methods >

Clib.strftime() Method


This method creates a string that describes the date or the time or both, and stores it in a variable.

Syntax

Clib.strftime(stringVar, formatString, Time)

Parameter
Description

stringVar

A variable to hold the string representation of the time

formatString

A string that describes how the value stored in stringVar is formatted, using the conversion characters listed in the Usage topic

Time

A time object as returned by Clib.localtime()

Returns

A formatted string as described by formatString.

Usage

For details on the Time object, read The Time Object. The following conversion characters are used with Clib.strftime() to indicate time and date output:

Character
Description

%a

Abbreviated weekday name (Sun)

%A

Full weekday name (Sunday)

%b

Abbreviated month name (Dec)

%B

Full month name (December)

%c

Date and time (Dec 2 06:55:15 1979)

%d

Two-digit day of the month (02)

%H

Two-digit hour of the 24-hour day (06)

%I

Two-digit hour of the 12-hour day (06)

%j

Three-digit day of the year from 001 (335)

%m

Two-digit month of the year from 01 (12)

%M

Two-digit minute of the hour (55)

%p

AM or PM (AM)

%S

Two-digit seconds of the minute (15)

%U

Two-digit week of the year where Sunday is the first day of the week (48)

%w

Day of the week where Sunday is 0 (0)

%W

Two-digit week of the year where Monday is the first day of the week (47)

%x

The date (Dec 2 1979)

%X

The time (06:55:15)

%y

Two-digit year of the century (79)

%Y

The year (1979)

%Z

The name of the time zone, if known (EST)

%%

The percent character (%)

Example

The following example displays the full day name and month name of the current day:

var TimeBuf;
Clib.strftime(TimeBuf,"Today is %A, and the month is %B",
   Clib.localtime(Clib.time()));
TheApplication().RaiseErrorText(TimeBuf);

See Also

Clib.asctime() Method
Clib.localtime() Method

Siebel eScript Language Reference