Siebel VB Language Reference > Using Siebel VB > About Formatting Strings >

Date and Time Formats


This topic describes date and time formats that you can use with the Set String Format method. For more information, see Set String Format Method.

Predefined Date and Time Formats

Table 18 describes predefined date and time formats that you can use.

Table 18. Predefined Date and Time Formats
Format
Description

General Date

Note the following:

  • If the number includes an integer part and a fractional part, then it displays date and time information. For example, 11/8/2011 1:23:45 PM.
  • If the number includes only an integer part, then it displays this integer as a date.
  • If the number includes only a fractional part, then it displays this fractional part as time.

Long Date

Displays a long date. The International section of the Control Panel defines a long date.

Medium Date

Displays the date using the month abbreviation without the day of the week. For example, 08-Nov-2011.

Short Date

Displays a short date. The International section of the Control Panel defines a short date.

Long Time

Displays a long time. The International section of the Control Panel defines a long time. It includes hours, minutes, and seconds.

Medium Time

Does not display seconds. It displays hours in a 12 hour format and uses the AM and PM designator.

Short Time

Does not display seconds. It uses a 24 hour format and does not use the AM and PM designator.

Custom Date Formats

You can use a series of tokens in the format argument to define a custom format for a date. Siebel VB replaces each token in the output string with an appropriate corresponding value.

Table 19 describes the tokens that you can use.

Table 19. Tokens You Can Use
Token
Output

c

The equivalent of the format ddddd ttttt.

ddddd

The current date, including the day, month, and year according to the current Short Date setting of the computer. The following format is the default Short Date setting for the United States:

m/d/yy

dddddd

The current date, including the day, month, and year according to the current Long Date setting of the computer. The following format is the default Long Date setting for the United States:

mmmm dd, yyyy

ttttt

The current time, including the hour, minute, and second using the current time settings of the computer. The following format is the default time setting for the United States:

h:mm:ss AM/PM

Specifying Individual Parts of a Custom Date Format

Table 20 describes the tokens that you can use to specify individual parts of a custom date format.

Table 20. Tokens You Can Use to Specify Individual Parts of a Custom Date Format
Token
Output

d

The day of the month as a one or two digit number in the range of 1 through 31.

dd

The day of the month as a two digit number in the range of 1 through 31.

ddd

The day of the week as a three letter abbreviation in the range of Sun through Sat.

dddd

The day of the week without abbreviation in the range of Sunday through Saturday.

w

The day of the week as a number, where Sunday is 1 and Saturday is 7.

ww

The week of the year as a number in the range of 1 through 53, where the first week of January is always week 1.

m

The month of the year or the minute of the hour as a one or two digit number:

  • If the preceding token is an hour, then the minute is the output.
  • If the preceding token is not an hour, then the month is output.

mm

The month or the year or the minute of the hour as a two digit number:

  • If the preceding token is an hour, then the minute is the output.
  • If the preceding token is not an hour, then the month is output.

mmm

The month of the year as a three letter abbreviation in the range of Jan through Dec.

mmmm

The month of the year without abbreviation in the range of January through December.

q

The quarter of the year as a number in the range of 1 through 4.

y

The day of the year as a number in the range of 1 through 366.

yy

The year as a two digit number in the range of 00 through 99.

yyyy

The year as a three digit or a four digit number in the range of 100 through 9999.

h

The hour as a one digit or a two digit number in the range of 0 through 23.

hh

The hour as a two digit number in the range of 00 through 23.

n

The minute as a one digit or a two digit number in the range of 0 through 59.

nn

The minute as a two digit number in the range of 00 through 59.

s

The second as a one digit or a two digit number in the range of 0 through 59.

ss

The second as a two digit number in the range of 00 through 59.

Using a 12 Hour Format

Table 21 describes the tokens that you can use that use a 12 hour format. Siebel VB uses a 24 hour format, by default.

Table 21. Tokens That Use a 12 Hour Format
Token
Output

AM/PM

This token displays the following formats:

  • An uppercase AM with any hour that occurs before noon.
  • An uppercase PM with any hour that occurs between noon and 11:59 PM.

am/pm

This token displays the following formats:

  • A lowercase am with any hour that occurs before noon.
  • A lowercase pm with any hour that occurs between noon and 11:59 PM.

A/P

This token displays the following formats:

  • An uppercase A with any hour that occurs before noon.
  • An uppercase P with any hour that occurs between noon and 11:59 PM.

a/p

This token displays the following formats:

  • A lowercase a with any hour that occurs before noon.
  • A lowercase p with any hour that occurs between noon and 11:59 PM.

AMPM

This token displays the following formats:

  • The contents of the 1159 string (s1159) in the WIN.INI file with any hour that occurs before noon.
  • The contents of the 2359 string (s2359) with any hour that occurs between noon and 11:59 PM. Note that ampm is equivalent to AMPM.
Siebel VB Language Reference Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices.