Pitney Bowes MapInfo Professional User Manual

Page 245

Advertising
background image

If you have existing data and want to add Time or DateTime content to it, check the following table to
ensure that the data is in a format that MapInfo Professional can recognize as Time or DateTime.

Table 1: Time and DateTime Data Formats

To Format for DateTime

To Format for Time

Enter

yyyyMMdd

Not Applicable.

Date

Sets value to the specified Date at
midnight.

HHmmssfff

HHmmssfff.

Time

Sets value to current date at specified
Time. Can also use the locale settings

Can also use the locale settings for a
Time string.

for Date and Time strings separated by
a space.

yyyyMMddHHmmssfff

yyyyMMddHHmmssfff

DateTime

Sets value to Time portion of DateTime
value.

where:

HH refers to hours, mm refers to minutes, ss refers to seconds, ff refers to fractions of seconds, yyyy
refers to years, MM refers to month, dd refers to date

Converting Existing Data to Time or DateTime Data Types

If you have Time or DateTime data in your tables already, check to see if it is in the format you want by
checking the

Time and DateTime Data Formats

. If you have a lot of data and it is not in the format you

require for your tasks, you can use one of the MapBasic conversion functions to assist you with this
process.

DateTime

Time

Date

Converting

String can be in the form
yyyyMMddHHmmssfff or can

String can be in the form
HHmmssfff or can use the

Assumes the form
yyyyMMdd or locale settings

String

use the locale settings for

locale settings for a Time
string. **

for a date string if Date
format is "local" or the U.S.
form if Date format is "US".
*

Date and Time strings
separated by a space. ***

Assumes the form
yyyyMMddHHmmssfff. If any

Assumes the form
HHmmssfff. If any portion of

Assumes the form
yyyyMMdd. If any portion of

Number

portion of the DateTime is

the Time is invalid the value

the Date is invalid the value

invalid the value is set to null

is set to null and display this

is set to null. May display

and display this error: "Could
not convert data."

error: "Could not convert
data."

this error: "Could not convert
data."

Sets value to the specified
Date at midnight.

Sets value to null and
display this error: "Could not
convert data."

No conversion

Date

Sets value to current date at
specified Time.

No conversion

Sets value to null. May
display this error: "Could not
convert data."

Time

245

MapInfo Professional User Guide

Chapter 9: Selecting and Querying Data

Advertising