How to set date locale in mailchimp? - email

I need to change the mailchimp locale *|DATE:M y|*. This gives Apr 2013 and I want Abr 2013 (Portuguese format). Is there any way to do this?
Thanks!

Have you tried wrapping the date with a translate merge tag?
*|TRANSLATE:PT|* *|DATE:M y|*
http://blog.mailchimp.com/automatically-translate-your-emails-to-over-30-languages/
The list of language codes can be found here:
http://kb.mailchimp.com/article/is-it-possible-to-translate-content-in-multiple-languages
But the Portugese options are:
Portuguese (Brazil) = pt
Portuguese (Portugal) = pt_PT

There you go
setlocale(LC_ALL, 'pt_PT');
echo strftime("%b %d %Y");
this will output
Abr 18 2013
To format dates in other languages, you need to use the setlocale() and strftime() functions

Related

iMacros - Change date Format

I have an iMacros script working with data extracted from csv file.
I am trying to change a format date different as is extracted from my csv file.
I need
08-24-2022 to be replaced with Aug 24, 2022
basically d-mmm-yy with mmm d, yyyy
I tried something like this,, don't know how to make it work, Thank you for support!
SET date "08-24-2022"
SET dateFormatted EVAL("\"{{date}}\".replace(/(\\d{4})-(\\d\\d)-(\\d\\d)/, \"$2 $3, $1\");")
PROMPT {{dateFormatted}}
I am using:
Browser: Google Chrome Version 105.0.5195.102 (Official Build) (64-bit)
iMacros Personal Edition License - Addon for Chrome -Version 10.1.1
Windows 10 (64-bit)
One "easy" Implementation: Declare the Months yourself in a Var/Array and use the Month Number as Index (to re-split() the Array into the 12 Months) to convert it to the mmm Format, stg like:
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
SET date "08-24-2022"
'SET dateFormatted EVAL("\"{{date}}\".replace(/(\\d{4})-(\\d\\d)-(\\d\\d)/, \"$2 $3, $1\");")
SET Months _Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec_
SET dateFormatted EVAL("var d='{{date}}', m='{{Months}}', x,y,z; x=d.split('-'); y=m.split('_')[x[0]*1]; z=y+' '+x[1]+', '+x[2]; z;")
PROMPT _{{dateFormatted}}_
For Date="08-24-2022", this will output Aug 24, 2022.
For Date="08-04-2022", this will output Aug 04, 2022.
(=> Use x[1]*1 instead of x[1] in z if you would prefer Aug 4, 2022 for 1-Digit Dates from 01-09 to remove the Leading 0...)
(Written and tested in iMacros for FF v8.8.2, PM v26.3.3, Win10_PRO_21H2.)

12h cycle AM/PM in Fluid

In TYPO3 I am using the News Extension to create an Event. In my List view I am using the following code snippet to show the End Time of the Event.
<f:format.date format=" - %H:%M Uhr">{newsItem.eventEnd}</f:format.date>
Which results in " - 20:00 Uhr" (German Language, hence the "Uhr").
I want a Format that switches that time to " - 08:00 PM" for the English translation, I am assuming that is not possible in Fluid since my searches have no result. Is there any workaround?
You can put your format into a locallang file. There it's possible to change the format related to the language.
<f:format.date format="{f:translate(key:'dateFormat')}">{newsItem.eventEnd}</f:format.date>
The date format viewhelper uses the same format as the default PHP date and strftime functions, so anything you can use %I:%M %p to get 08:00 PM. See http://php.net/manual/en/function.date.php and http://php.net/strftime for more about this.

Can not find a date pattern

Can't find a pattern for this date. Could anyone help me?
I know it's ISO 8601 standart.But everything I have found was without : between 03 and 00.
2018-01-18T08:40:00+03:00
How do I can parse this to Thu Jan 18 00:00:00 GMT+03:00 2018 to this 2018-01-18T08:40:00+03:00?
It looks like this W3C Datetime format is typically used for < lastmod > timestamps in XML.
related & more detailed answer here

$Date.Format on Silverstripe 4 Template

I have a date in the database with this format "YY-mm-dd". On the template I want it in this format: dd.mm.YY
Usually it would work with $date.Format('d.m.Y')
But not in Silverstripe 4. It converts from 2018-05-08 to 8.0.2018. Only the year is correct. Was there a change. I didn't find anything in the Documentation
Date formats in SS4 were changed from PHP date formatting to CLDR date formatting (changelog link):
Changed Format() method to use CLDR format strings, rather than PHP format string. E.g. d/m/Y H:i:s (php format) should be replaced with to dd/MM/y HH:mm:ss (CLDR format).
You can use this to achieve what you want:
$Date.Format('dd.MM.y')
The guide mentioned in the previous answer regarding date formatting has moved. The new location for CLDR date formatting as used by Silverstripe 4 can be found here:
https://unicode-org.github.io/icu/userguide/format_parse/datetime/#date-field-symbol-table

GWT: date format changing itself in firefox when run on server

In my GWT application , i am displaying some dates , which are displaying in different format in chrome .. and different in Firefox ..
in chrome i am having this
9/7/2013 6:23:03 PM
in firefox its showing as
Saturday, September 07, 2013 6:23:03 PM
I am not changin format anywhere ...
I like the date to be same (as in chrome)
Note: it works fine and shows same format(as in chrome), but when i run on localhost it shows different format ..
any idea , what could be the solution
thanks
Use the GWT DateTimeFormat to show dates in a uniform manner. DateTimeFormat.getFormat("MM/dd/yyyy h:mm:ss a").format(YOUR_DATE); will give you a String.