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

  • Home
  • SEARCH
  • 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 6862963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:43:30+00:00 2026-05-27T02:43:30+00:00

I am using android.text.format.DateFormat.format(yyyy-MM-dd hh:mm:ss, new java.util.Date()) to get time & date. The problem

  • 0

I am using android.text.format.DateFormat.format("yyyy-MM-dd hh:mm:ss", new java.util.Date()) to get time & date. The problem is it isn’t formated in a way that I can use it as part of a filename – I am creating log files, and I need the format of like 20111123_123412 or something that is possible to directly use as part of a file name. How do I get that easily from Android?

THanks

  • 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-27T02:43:31+00:00Added an answer on May 27, 2026 at 2:43 am

    What about this?

    android.text.format.DateFormat.format("yyyy_MM_dd_hh_mm_ss", new java.util.Date());
    

    EDIT:

    I used Something like,

    SimpleDateFormat formatter = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
    Date date = new Date();
    String fileName = formatter.format(date);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the return type of the following code, android.text.format.DateFormat.format(MM/dd/yyyy hh:mm, new java.util.Date()); I'm
android.text.format.DateFormat specifies that using the format string 'a' should yield 'a' or 'p' and
I would like to be able to format java.util.Date objects in a long English,
I have a Calendar object, and i know how to format it using android.text.format()
I made an android project using eclipse. It looks like: src/ ActivityMain.java lib/ Square.java
How to open a text file in android.I am using android 1.5 emulator and
I am developing a program drawing text on screen using android NDK in C
While trying to transform the date format I get an exception:unparseable date and don't
I am new starter android. I have simple question. When I choose date through
I'm using android:shadowDx and android:shadowDy .. for a text and they work fine, can

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.