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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:54:44+00:00 2026-05-14T18:54:44+00:00

Is there an easy way to present time (hh:mm) as a decimal value? Example,

  • 0

Is there an easy way to present time (hh:mm) as a decimal value?
Example, 01:08 should become 1,13.

I have an asp:textbox masked (ajax) as time with the mask format “99:99”. Next to this box I need to present the entered value as decimal.

<asp:TextBox ID="time" runat="server" /> hh:mm ([time in decimal format])
<ajaxToolkit:MaskedEditExtender runat="server" Mask="99:99" TargetControlID="time" MaskType="Time" />
  • 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-14T18:54:44+00:00Added an answer on May 14, 2026 at 6:54 pm
    double decimalTime = DateTime.Now.Hour + (double)DateTime.Now.Minute/60
    

    Edit: Better way, using GenEric’s TimeSpan idea:

    double hours = new TimeSpan(DateTime.Now.Hour, 
                                DateTime.Now.Minute, 
                                0).TotalHours;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET web application that leverages 5 DLLs. This web application and
Short version: When two lists are adjacent to each other, is there a way
Scenario I have the following methods: public void AddItemSecurity(int itemId, int[] userIds) public int[]
A base project contains an abstract base class Foo. In separate client projects, there
Say we have a list of rooms with their capacities and a list of
ASP.net web method: [WebMethod()] public Data.Subtitle[] GetAll() { return Data.Subtitle.FindAll(); } Here's the Subtitle
I'm using visual studio 2008 I have a control that dispays a processed image.
Assume I have a working copy of a project versioned with svn. For a
I have a cron script that executes a PHP script every 10 minutes. The
function simple_form($form_state) { $form['item'] = array('#type' => 'hidden', '#value' => 'some_value'); $form['#action'] = 'http://external-website.com/';

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.