SftMask/OCX 6.5

SftMaskCalendar.FormatTime Method

Softel vdm, Inc.

Converts a time into a displayable string.

Syntax       

VB.NET

object.FormatTime(ByVal Dt As Date, ByRef Text As String)

VB

object.FormatTime(ByVal Dt As Date, Text As String)

C#.NET

void object.FormatTime(System.DateTime Dt, ref string Text);

VC++

HRESULT object->FormatTime(DATE Dt, _bstr_t* Text);

C

HRESULT object->raw_FormatTime(DATE Dt, BSTR* Text);

Delphi

procedure object.FormatTime(Dt : TDateTime, var Text : WideString);

object

A SftMaskCalendar object.

Dt

The time to be converted to a string. The converted time is returned in the Text argument.

Text

Defines the desired formatting for the specified Time Dt and returns the converted time as a string. If an empty string is specified, the time is formatted using the default user locale.

Comments

The FormatTime method converts a time into a displayable string.

The FormatTime method uses the Windows GetTimeFormat API to format the specified time Dt.

Text can be defined as an empty string or can consist of one or more of the following items:

Text

Description

h

Hours without leading zero for single-digit hours - 12-hour clock

hh

Hours with leading zero for single-digit hours - 12-hour clock

H

Hours without leading zero for single-digit hours - 24-hour clock

HH

Hours with leading zero for single-digit hours - 24-hour clock

m

Minutes without leading zero for single-digit minutes

mm

Minutes with leading zero for single-digit minutes

s

Seconds without leading zero for single-digit seconds

ss

Seconds with leading zero for single-digit seconds

t

One character time-marker string, such as A or P.

tt

Full length, multicharacter time-marker string, such as AM or PM

Literal characters must be enclosed by single quotes.

Text = "hh':'mm':'ss tt"

To specify a literal single quote, use two quotes.

Calendar.FormatTimeV is used for languages such as VBScript, which are limited by requiring Variant arguments and do not support strongly typed arguments for return values. For more information please see Using SftMask/OCX with Internet Explorer.


Feedback / comments / error reports for this topic
© 2000, 2008 - Softel vdm, Inc. - www.softelvdm.com