Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:02:58+00:00 2026-05-30T22:02:58+00:00

I have a file with a lot of data in it, one being a

  • 0

I have a file with a lot of data in it, one being a last-modified=”1231231231″

where 1231231231 is epoch time in milliseconds

<Translation 
  author_id="25" 
  id="02f18edd-ef7a-48e2-b614-b5888936017e"
  language="de_DE" 
  last_modified="1325669156960" 
  phase="1" 
  target="[ phase=&quot;1&quot; language=&quot;de_DE&quot; ]"
  translation_text="Funktionen"/>

Note the: last_modified=”1325669156960″

I can run this:

:%s/\([0-9]\{10\}\)\([0-9]\{3\}\)/\1/g  

to find all these occurrences and replace them with a “seconds” string:

last_modified=”1325669156″

I can then pattern match on those 10 digits, and what I’d like to do is pipe them to the unix data -d command to return a formatted data stamp:

:%s/[0-9]\{10\}/&/g 

In this example, instead of replacing with the same value as I found (I.e, the &),

I’d like to somehow pipe that value to what would be essentially:

date -d &

and return that as a formatted time stamp in the

last_modified="Wed Jan  4 07:13:32 MST 2012"

Any ideas on how to do this? I have to do this about every other week on various files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:02:59+00:00Added an answer on May 30, 2026 at 10:02 pm

    You can use strftime() in vim. Find one proper format string to meet your needs.
    I’m using %c here:

    :%s/last_modified="\zs\(\d\{10}\)\d\{3}/\=strftime('%c', str2nr(submatch(1)))/g
    

    result:

    <Translation 
      author_id="25" 
      id="02f18edd-ef7a-48e2-b614-b5888936017e"
      language="de_DE" 
      last_modified="2012-1-4 17:25:56" 
      phase="1" 
      target="[ phase=&quot;1&quot; language=&quot;de_DE&quot; ]"
      translation_text="Funktionen"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that returns a lot of data into a CSV file.
I am creating Excel file download using NOPI libraries. I have lot of data
I have a test file that contains tests taking quite a lot of time
The problem: I have a .sav file containing a lot of data from a
I have a lot of data in an XML file that I need to
I have followed three tutorials, one on submitting form data to a php file,
I have a .txt file with a lot of records (lines of data) in
i have a file which contains a lot of update query and some other
I have a PHP file that contains a lot of if and else statements
I have a lot of images (.png) file. Now i want to rename the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.