Maptitude GISDK Help

ParseDateTime()

Summary

Parses a string to create a DateTime compound variable.

 

Changes

Added to Version 2013.

 

Syntax

datetime = ParseDateTime(string input, string format_string)  

 

Argument

Contents

input

A string with a date and/or time

format_string

A string containing a combination of the following standard system formats and/or specifiers

 

Standard System Format

Description

@d

Short date

@D

Long date

@t

Short time

@T

Long time

 

Specifier

Description

d

The one- or two-digit day.

dd

The two-digit day. Single-digit day values are preceded by a 0.

ddd

The three-character day-of-week abbreviation.

dddd

The full day-of-week name.

h

The one- or two-digit hour in 12-hour format.

hh

The two-digit hour in 12-hour format. Single digit values are preceded by a 0.

H

The one- or two-digit hour in 24-hour format.

HH

The two-digit hour in 24-hour format. Single digit values are preceded by a 0.

m

The one- or two-digit minute.

mm

The two-digit minute. Single digit values are preceded by a 0.

M

The one- or two-digit month number.

MM

The two-digit month number. Single digit values are preceded by a 0.

MMM

The three-character month abbreviation.

MMMM

The full month name.

s

The one- or two-digit seconds.

ss

The two-digit seconds. Single digit values are preceded by a 0.

t

The one-letter A.M./P.M. abbreviation (e.g., A.M. is displayed as "A").

tt

The two-letter A.M./P.M. abbreviation (e.g., A.M. is displayed as "AM").

y

The one-digit year (e.g., 2001 is displayed as "1").

yy

The last two digits of the year (e.g., 2001 is displayed as "01").

yyyy

The full year (e.g., 2001 is displayed as "2001").

 

Returns

A DateTime compound variable with date and/or time properties.

 

Notes

Examples

dt = ParseDateTime("1/3/2013 10:11:19 PM",)

ShowMessage(FormatDateTime(dt,))

 

dt = ParseDateTime("2013.1.3 22:9:43","yyyy.M.d HH:m:s")

ShowMessage(FormatDateTime(dt,))

ShowMessage(FormatDateTime(dt, "ddMMMyyyy hh:mm:ss t"))

 

See Also

Function

Summary

CreateDate()

Creates a DateTime compound variable with just a date

CreateDateTime()

Creates a DateTime compound variable

CreateTime()

Creates a DateTime compound variable with just a time

GetDateAndTime()

Determines the current date and time according to the system clock

 

 

©2025 Caliper Corporation www.caliper.com