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-09-26
ft:lastPublication
2025-09-26T10:03:58.880000

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

For more information about the meaning of the fmt argument, see Date and Time Format Strings section.