Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

Hi,

we have an unexpected behavior with date variables. (PB 12.1 Classic, Build 6807)

Here a simple example:

date ld_today

ld_today = Today()

MessageBox ("Value", string (ld_today, "dd.mm.yyyy hh:mm:ss"))

The MessageBox shows a date with time. (not 00:00:00 as expected)

If I set the value in a datawindow column of type datetime the time is also included.

This is contrary to information in the help.

Date datatype:

"The date, including the full year (1000 to 3000), the number of the month (01 to 12), and the day (01 to 31)."

Nothing about time here.

Today function:

"Return values: Date

Usage: Although the datatype of the Today function is date, it can also return the current time. This occurs when Today is used as an argument for another function and that argument allows different datatypes."

But Today() is not an argument for another function here.

Workarounds I know:

Explicit conversion to date

ld_today = Date(Today())

or to datetime

MessageBox ("Value", string (DateTime (ld_today), "dd.mm.yyyy hh:mm:ss"))

Both removes the time or sets it to 00:00:00.

2 Comments
Labels in this area