Automatic date reformating DE->US
Thread poster: Anthony Rudd

Anthony Rudd

Local time: 21:58
Dec 31, 2017

I have the recurring problem of needing to change dates from German format (mm.dd.yyyy, such as 31.12.2017) to US format (yyyy-dd-mm, such as 2017-12-31). Is there some way of automating this process (a large number of date fields is involved). A related problem is there some way of stopping the QA from flagging these as errors, missing number, added number, etc.?

Direct link Reply with quote
 

Anthony Rudd

Local time: 21:58
TOPIC STARTER
"Replace with" regex not handled correctly. Dec 31, 2017

I have been doing some experimenting, and have written a simple regex that finds the dates that I want:
\d{1,2}\.\d{1,2}\.\d{4}

But when I try to use the matching replacement string in the "Replace with:" expression
$3-$2-$1

$3 etc. are not treated as regexes, but rather the complete string is "$3-$2-$1" replaces the found string.

How do I force the Find/Replace to use regexes?


Find what:
\d{1,2}\.\d{1,2}\.\d{4}
Replace with:
$3-$2-$1

Use regular expressions: activated


Direct link Reply with quote
 

Anthony Rudd

Local time: 21:58
TOPIC STARTER
regex error Dec 31, 2017

I found the error, the individual were not enclosed within brackets, namely,
(\d{1,2})\.(\d{1,2})\.(\d{4})

But what I am still missing is how to include the same matching in QA to avoid false messages.


Direct link Reply with quote
 

Anthony Rudd

Local time: 21:58
TOPIC STARTER
Regex to convert month name to month number Jan 5

The RE (\d*)\.(\w*)\.(\d*)
And substution $3-$2-$1
reformats an EU date (such as 21.Feb.2017) to a USA date (2017-Feb-2017)
But how can I convert the month name(e.g. Feb) to the month number (02)?
I have found some snippets, but none that does the task I require.
Can anyone help? I have many dates that need to be converted.


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Automatic date reformating DE->US

Advanced search






WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »
Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search