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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:06:58+00:00 2026-06-01T14:06:58+00:00

For example: 2011-08-11 16:59 becomes 2011-08-11 16:30

  • 0

For example:

2011-08-11 16:59 becomes 2011-08-11 16:30

  • 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-01T14:07:00+00:00Added an answer on June 1, 2026 at 2:07 pm

    I would say something like that

    var time = DateTime.Now;
    var rounded = time.AddMinutes(
            time.Minute>30 ? -(time.Minute-30) : -time.Minute) 
    

    And you could even do your own extension

    public static class TimeHelper {
       public static DateTime RoundDown (this DateTime time)
       {
           return time.AddMinutes(
             time.Minute>30 ? -(time.Minute-30) : -time.Minute);
       }
    }
    

    EDIT

    This function cut’s also the seconds / milliseconds if necessary. Thanks for the hint.

    public static DateTime RoundDown(this DateTime time)
    {
        return time.Subtract(
            new TimeSpan(0, 0, time.Minute > 30 ? (time.Minute - 30) : time.Minute, 
                time.Second, time.Millisecond));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE 2011.09.13 This bug has been resolved by Adobe. The example code below now
I am learning knokcout.js I was using the example in http://www.knockmeout.net/2011/04/utility-functions-in-knockoutjs.html , which is
Currently i have made a bar chart from a listbox from this example: http://weblogs.thinktecture.com/cnagel/2011/06/wpf-listbox-as-bar-chart.html
I want the date&time to be in this format. For example 2012/3/21 23:47:01 2011/11/23
I'm building the example shown in this tutorial: http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/ And I'm get some errors
i have one date. example : $date='2011-21-12' ; data format :yyyy-dd-mm; IF date is
I have a list of dates, for example: ['2011-02-27', '2011-02-28', '2011-03-01', '2011-04-12', '2011-04-13', '2011-06-08']
I have an NSDate object with value for example: 2011-08-26 14:14:51, I want to
For example I want to update all records to '2012-01-01' ( time : ISODate(2011-12-31T13:52:40Z)
I set a custom title bar as example http://coderzheaven.com/2011/06/custom-title-bar-in-android/ , every thing works fine

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.