Page 1 of 2 1 2 >
Topic Options
#57637 - 08/27/20 12:23 PM Covert date to french
Luc Offline
OL Toddler

Registered: 02/26/15
Posts: 36
Loc: Montreal
Hi,
How can I convert my system date Thursday, August 27, 2020 to french: 27 Août 2020. ?

Thanks

Top
#57638 - 08/27/20 12:30 PM Re: Covert date to french [Re: Luc]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 650
Loc: Québec, Canada
Since the Date() function in PressTalk will use the language of the Regional system where the form is executed, you would need to do it via a script in Workflow prior to executing your form.
Then pass the formatted date as a variable or jobinfo to the form.
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top
#57639 - 08/27/20 12:33 PM Re: Covert date to french [Re: Luc]
Luc Offline
OL Toddler

Registered: 02/26/15
Posts: 36
Loc: Montreal
Can it be done in desing without workflow?

thanks

Top
#57640 - 08/27/20 01:15 PM Re: Covert date to french [Re: Luc]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 650
Loc: Québec, Canada
Yes but that would require a PressTalk that takes your date and convert it to its french counterpart. Since there is no such function, you would have to build it from scratch.

Now you say "...without workflow...". If the date is already in the data, then yes. But know that the Date() function cannot work in a printer as there is no system date.
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top
#57641 - 08/27/20 01:39 PM Re: Covert date to french [Re: Luc]
jouberto Offline
OL Toddler

Registered: 04/18/18
Posts: 49
There is a provided set of functions in our presstalk libraries that will do precisely that in Design, without workflow, in French.

Let me know if you cannot find them or I will try to provide as many details as possible

Top
#57642 - 08/27/20 01:40 PM Re: Covert date to french [Re: Luc]
jouberto Offline
OL Toddler

Registered: 04/18/18
Posts: 49

Top
#57643 - 08/27/20 01:42 PM Re: Covert date to french [Re: Luc]
jouberto Offline
OL Toddler

Registered: 04/18/18
Posts: 49
you will want to import in your document the following functions:
- Normalize date
- GetDayNameF
- GetMonthNameF
- FormatDateF

Top
#57644 - 08/27/20 01:45 PM Re: Covert date to french [Re: Luc]
jouberto Offline
OL Toddler

Registered: 04/18/18
Posts: 49
Another way to do this, since you already have the fully spelled days and months in english, would be to build arrays of days and months, in french and english, and find the position of the current english day and month from your data, and pull the value from the corresponding position in the french array to display on the form. A bit of work but not too complex.

Top
#57645 - 08/27/20 01:46 PM Re: Covert date to french [Re: Luc]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 650
Loc: Québec, Canada
Ah!...good to know...thanks @jouberto
_________________________
♪♫♪♫
99 frigging bugs in my code
99 frigging bugs
Take one down
Code around
127 frigging bugs in my code
♪♫♪♫

Top
#57646 - 08/27/20 02:49 PM Re: Covert date to french [Re: jouberto]
Luc Offline
OL Toddler

Registered: 02/26/15
Posts: 36
Loc: Montreal
Thanks

I now have the functions But I don't know how to use them

Would you have a code sample I could look into
I just want to write the date of the day on a letter in english or french depending on language

thanks

Top
Page 1 of 2 1 2 >