Topic Options
#56829 - 03/07/19 05:05 PM system date
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 324
Loc: Home
My system date shows "Thursday, March 07,2019"
How can I remove Thursday

I checked my system date and it's right.

PressTalk After is
show(date(true))

can any one help. We are printing directly from Design without using the Watch.

THANKS
_________________________
Peace

Top
#56830 - 03/08/19 09:28 AM Re: system date [Re: Sami786]
RobertOtis Offline
OL User

Registered: 08/26/13
Posts: 82
Loc: Montreal,Quebec
Sami786,

http://help.objectiflune.com/en/planetpress-design-user-guide/7.6/Default_CSH.html#/2944.html


Example
show(date(true))
Result
On a system set to French (Canada), returns 08 mars 2019.

Top
#56831 - 03/08/19 11:08 AM Re: system date [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 324
Loc: Home
Robert, client requirement is to print date as they like "March, 08 2019" . I guess I need to somehow fix this, I wish we could easily use date function like we can in Watch. %m %d %y. I'll keep trying. thanks anyways.
_________________________
Peace

Top
#56911 - 04/04/19 10:05 AM Re: system date [Re: Sami786]
rfielder Offline
OL Toddler

Registered: 10/28/15
Posts: 32
Could you assign the date to a variable, then strip off the first word, then display what is left?

Also, since adding the reply above, I realized I had seen date(true) give both formats. I wonder if it is effected by the settings of the computer you are working on?


Edited by rfielder (04/04/19 02:15 PM)

Top
#56914 - 04/04/19 11:12 AM Re: system date [Re: Sami786]
Philippe F. Online   content
OL Expert

Registered: 09/06/00
Posts: 1928
Loc: Objectif Lune, Montreal, Qc
Use something like this:
Code:
define(&today,string,date(false))
define(&y,string,mid(&today,1,4))
define(&m,integer,strtoint(mid(&today,6,2)))
define(&d,string,mid(&today,9,2))
define(&months,arraystring,['January','February','March','April','May','June','July','August','September','October','November','December'])

showcenter(&months[&m-1]+' '+&d+', '+&y)

This code assumes that your current system's short date format is set to yyyy-mm-dd or yyyy/mm/dd (the separator is irrelevant). It then extracts all three elements of the date and uses an array to lookup the name of the month based on its numerical value.

Note that using date(false) returns the short date format (as opposed to date(true), which returns the long date format). The short date format is much easier to parse and work with.

If your short date is using another format, adjust the code accordingly.


Edited by Philippe F. (04/04/19 11:14 AM)
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#56915 - 04/04/19 11:14 AM Re: system date [Re: Sami786]
Sami786 Offline
OL Expert

Registered: 01/29/14
Posts: 324
Loc: Home
Great, thank you so much smile
_________________________
Peace

Top