
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 DateTimeTo Format for TimeEnter
yyyyMMddNot Applicable.Date
Sets value to the specified Date at
midnight.
HHmmssfffHHmmssfff.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.
yyyyMMddHHmmssfffyyyyMMddHHmmssfffDateTime
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.
DateTimeTimeDateConverting
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 forlocale 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 isthe Time is invalid the valuethe Date is invalid the value
invalid the value is set to nullis set to null and display thisis 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 conversionDate
Sets value to current date at
specified Time.
No conversionSets value to null. May
display this error: "Could not
convert data."
Time
245MapInfo Professional User Guide
Chapter 9: Selecting and Querying Data
Kommentare zu diesen Handbüchern