Date and Time Format

You can customize the date and time format for test data generation to a script or live database connection using DBMS items in the Format category.

PowerDesigner uses the PhysDataType map item in the script\data types category to convert the physical data types of columns to conceptual data types because the DBMS items are linked with conceptual data types.

Example for Sybase AS Anywhere 7:

Physical data type

Conceptual data type

DBMS entry used for SQL

DBMS entry used for live connection

datetime

DT

DateTimeFormat

OdbcDateTimeFormat

timestamp

TS

DateTimeFormat

OdbcDateTimeFormat

date

D

DateFormat

OdbcDateFormat

time

T

TimeFormat

OdbcTimeFormat

If you want to customize the date and time format of your test data generation, you have to verify the data type of the columns in your DBMS, then find the corresponding conceptual data type in order to know which item to customize in your DBMS. For example, if the columns use the datetime data type in your model, you should customize the DateTimeFormat item in your DBMS.

The default date and time format is the following:

  • SQL: 'yyyy-mm-dd HH:MM:SS'

  • Live connection: {ts 'yyyy-mm-dd HH:MM:SS'}

Where:

Format

Description

yyyy

Year on 4 digits

yy

Year on 2 digits

mm

Month

dd

Day

HH

Hour

MM

Minute

SS

Second

For example, you can define the following value for the DateTimeFormat item for SQL: yy-mm-dd HH:MM. For live database connections, this item should have the following value: {ts 'yy-mm-dd HH:MM'}.