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

Anthony Rudd

Local time: 00:00
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: 00:00
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: 00:00
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: 00:00
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






memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

More info »
SDL MultiTerm 2019
Guarantee a unified, consistent and high-quality translation with terminology software by the industry leaders.

SDL MultiTerm 2019 allows translators to create one central location to store and manage multilingual terminology, and with SDL MultiTerm Extract 2019 you can automatically create term lists from your existing documentation to save time.

More info »



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