Topic Options
#56954 - 04/16/19 02:25 PM Date Format Changing when Printed
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
I am using date(false) for various purposes on forms. Up to now, it has been to display the date only.

On a new form, I am using date(false) as one of the arguments to the @DaysBetweenDates() function.

When developing the form in Designer, everything works very well.

However, when the form is printed, the date format is changed.

The server that runs Production is set to date format DD/MM/YYYY, as are all of our PCs.

When the form is printed, the date format changes to MM/DD/YYYY. This only happens when a workflow prints. It happens both when printing to paper, and when converting to PDF and saving.

To test this, I have a PressTalk object as the first object on the page. The PressTalk object is on the page, so I can see the output.

It shows the output of date(false) using show(). On screen in Designer, and on a soft proof, the date format is DD/MM/YYYY. When you print to paper or to PDF, the date format displayed by the PressTalk object is MM/DD/YYYY.

As a result, @DaysBetweenDates() can't correctly calculate.

I have checked everything I can find on the server, and it is all set to Canada as the location, and DD/MM/YYYY as the date format.

All printing is done to Generic drivers, as a PostScript environment, so the printer should not be able to change any of the data.

Has anyone encountered this?

Any suggestions why Production would alter the date format when printing?

Thanks in advance!

Top
#56955 - 04/16/19 02:27 PM Re: Date Format Changing when Printed [Re: rfielder]
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
Here is the PressTalk code. &OHIPIns and &UNorOOCIns are conditions.

Code:
set(&TempDate1,@(9,73,78)+'20'+@(9,79,80))
set(&InvAge,@DaysBetweenDates(&TempDate1,date(false),'DD/MM/YYYY'))

if(&OHIPIns)
        if(&InvAge>54)
                set(&Days60Flag,'1')
        elseif(&InvAge>24)
                set(&Days30Flag,'1')
        endif()
elseif(&UNorOOCIns)
        if(&InvAge>39)
                set(&Days45Flag,'1')
        endif
endif()

show(inttostr(&InvAge)+' days')
crlf()
show('Billing Date: '+@(9,73,80))
crlf()
show('Today: '+date(false))
crlf()
show('TempDate1: '+&TempDate1)
crlf()
show('Days30Flag='+&Days30Flag)
crlf()
show('Days45Flag='+&Days45Flag)
crlf()
show('Days60Flag='+&Days60Flag)
crlf()
if(&OHIPIns)
        show('OHIP Insurance')
elseif(&UNorOOCIns)
        show('UN/OOC Insurance')
endif()

Top
#57019 - 05/10/19 03:12 PM Re: Date Format Changing when Printed [Re: rfielder]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1928
Loc: Objectif Lune, Montreal, Qc
Check if the Document is set to print in printer-centric mode, because in that case the date format is determined by the printer.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top