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.)
Related
I have a sensor log file with dates in the form Mon Nov 30 18:21:40 UTC 2020 that I'd like to convert to OpenRefine dates.
Per GREL Date Functions, I thought the correct transformation would be value.toDate('E M d H:m:s z y'), but I consistently get "Error: Unable to convert to a date".
I've tried simple things like replacing UTC with GMT, without success.
What clue am I missing?
That's a weird date format. I'm not sure why a sensor log wouldn't just use ISO 8601.
Try using value.toDate('EEE MMM d H:m:s Z y').
It's not super obvious from the docs that you need multiple characters, but if you look at the examples at the bottom of this page, you can see them used there.
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
I have about 200 old emails, as *.eml files, that I want to concatenate into one *.org file so that I can use the information in Org mode. Each file has the string "Date: " followed by a timestamp in the RFC 5322 date format, i.e.
Date: Tue, 23 Apr 2019 13:31:18 -0400
I know the UNIX date command can convert the date part of that string to RFC 3339 date format, i.e. the command:
date --rfc-3339='ns' --date='Tue, 23 Apr 2019 13:31:18 -0400'
would give the result:
2019-04-23 13:31:18.000000000-04:00
I guess I could do all the conversion with awk in one go, but my awk is rusty, and I've been having trouble getting it right.
I'd really like to convert all of these dates to Org mode dates with one command, either using a vi command or a doom emacs command.
Any suggestions?
You could build up a regular expression for use with M-x query-replace-regexp which invokes a shell command to use the date command you mention above. The trick is the \, replacement option which allows you to execute any Emacs LISP code, as described in the Regexp Replacement section of the Emacs info manual.
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.
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
I'm successfully setting a date-picker with an initial date from a plist, but I see some unwanted blue values in the month, day, and year components, presumably corresponding to current date. So if today is April 18, 2010 and initial date being set is March 19, 2008, it looks like this (bold represents the blue):
January 17 2006
February 18 2007
------------------------------
March 19 2008
------------------------------
April 20 2009
May 21 2010
First question is: How do I get rid of the blue?
And second question: Ideally, how do I get it to look like this?
January 17 2006
February 18 2007
------------------------------
March 19 2008
------------------------------
April 20 2009
May 21 2010
Third question, totally unrelated and not as important: How could I have gotten the above to show in blue rather than bold? I see blue in code snippets all the time.
Matt
Sadly, I do not believe it's possible to suppress the coloring of the current date components in blue. You could always file a feature request for this functionality.
As a last resort, you could implement your own (or Google for "generic date picker" - someone has already done this).
I think the code sample formatter automagically makes things blue that it thinks are keywords, like:
UIDatePicker* myPicker;
I didn't tell it to make that blue, it just is.