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

Anthony Rudd

Local time: 04:40
German to English
+ ...
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.?

 

Anthony Rudd

Local time: 04:40
German to English
+ ...
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


 

Anthony Rudd

Local time: 04:40
German to English
+ ...
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.


 

Anthony Rudd

Local time: 04:40
German to English
+ ...
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.


 


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 »
SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running, helps experienced users make the most of the powerful features, ensures new

More info »



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