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 8152205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:38:38+00:00 2026-06-06T15:38:38+00:00

I have a string in the format yyyymmdd. It is a string in bash

  • 0

I have a string in the format “yyyymmdd”. It is a string in bash and I want to get it converted into a date so that all other date functions can be used on it.

“20121212” string into “20121212” date with format “%Y%m%d”.

  • 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-06-06T15:38:40+00:00Added an answer on June 6, 2026 at 3:38 pm

    This worked for me :

    date -d '20121212 7 days'
    date -d '12-DEC-2012 7 days'
    date -d '2012-12-12 7 days'
    date -d '2012-12-12 4:10:10PM 7 days'
    date -d '2012-12-12 16:10:55 7 days'
    

    then you can format output adding parameter ‘+%Y%m%d’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using String.Format how can i ensure all numbers have commas after every 3 digits
I have string like 123-123-1234 so I want to convert string into this format
So i have String trDate=20120106; and want to get Date trDate=2012-01-06 and am trying
I have a String Object in format yyyyMMdd .Is there a simple way to
I have a format string like this: buf[] = A%d,B%d,C%d,D%d,F%d,G%d,H%d,I%d,J%d; and I want to
Hi have Date in a string Format. datevalue= [Tue Mar 06 06:00:00 CET 2012].
I have a url in string format like this : str=http://code.google.com and some other
I have a database script that returns date time string and my problem is
I have a string.Format like this : string Test = string.Format({0:#,0}, NegativeNumber); how can
I have a string like this (YYYYMMDD): 20120225 And I want to have a

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.