DateTimeToString - spectrum_spatial - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-03-07
ft:lastPublication
2025-03-07T10:28:48.112000

Description

Converts a DateTime into a string.

Syntax

DateTimeToString ( datetime, fmt )

Arguments

datetime is a DateTime, and

fmt is a string identifying how to format the DateTime.

Example

Converts a datetime to a formatted string mm/dd/yyyy hh:mm:ss tt for all features where the country is Canada.

select DateTimeToString(RANDOMDATETIME, 'mm/dd/yyyy hh:mm:ss tt') from countries where country='Canada'

Remarks

Refer to the section titled Date and Time Format Strings for more information on the meaning of the fmt argument.