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

The Archive Base Latest Questions

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

How to fix date to retrieve minutes/hours with zeros ? e.g. it’s 05:09 AM

  • 0

How to fix date to retrieve minutes/hours with zeros ?

e.g. it’s 05:09 AM >

trace(_date.getHours()+":"+_date.getMinutes());  //5:9

but i want 05:09 instead of 5:9 – so how to add zeros ??

    var _date = new Date();

    ...

    _min = _date.getMinutes();

    //fix date:
                var _str:String = _min.toFixed(1);
                _min = Number(_str);

    trace(_date.getHours()+":"+_date.getMinutes());

= 5:9 …. -_-

what’s wrong ?

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

    You can format it with something like:

    minutes_txt:String = _date.getMinutes() < 10 ? “0” + _date.getMinutes() : _date.getMinutes();

    which will pad a zero if the minutes is less than 10, and then just trace that instead of only _date.getMinutes

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

Sidebar

Related Questions

I wanted to compare the current system date to a fix date, but get
To fix the UITextview blue color issue for links in ios ( i want
I have to fix a glitch with this code someone wrote but I'm not
I am trying to format a date: FORMAT(table.TCKT.TCKT_ISS_DATE, 'YYYY') AS TICKETYEAR but I am
Hopefully this will be a simple fix. I'm completely new to XSL but I've
I'm coding a date class and am having trouble with the post-fix increment (the
com.vaadin.data.Property$ConversionException: java.lang.NoSuchMethodException: java.sql.Date.(java.lang.String) What is the fix for this... here is my POJO class
I tried to do set date value to a PreparedStatement with default value but
I want to retrieve the 13 latest objects, which shows this in my shell:
I want to create a Date, Time and DateTime EditorTemplate using MVC3 and Razor.

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.