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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:57:38+00:00 2026-06-02T21:57:38+00:00

Is there any view similar to NSDatePicker for OS X, but for selecting durations

  • 0

Is there any view similar to NSDatePicker for OS X, but for selecting durations (i.e. hours, minutes and seconds) rather than entire dates. A Google search didn’t bring anything useful up, and I haven’t yet succeeded in customizing NSDatePicker to be suitable for durations only – my attempts don’t work properly with 12-hour (AM and PM) date modes and different timezones.

  • 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-02T21:57:39+00:00Added an answer on June 2, 2026 at 9:57 pm

    I don’t think there is any ready-made solution, but it shouldn’t be hard to make one of your own with 3 borderless text fields and a couple of labels with colons in them, all inside an NSBox with a stepper next to it.

    I think I found a way that works with an NSDate picker. I’m not sure why some of it works, but it seems necessary to set the locale to somewhere that uses a 24 hour clock, like Japan and set a calendar for the picker. The only “glitch” I see, is that there is a bit of a delay when typing in some 1 digit numbers (this is something Apple changed in OS X 10.5 I think to have the editor wait to see if you want to add a second digit). However, you can get it to update immediately by tabbing out of the field or clicking in another field. So here’s the setup:

    self.picker.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"ja_JP"];
        self.cal = [NSCalendar currentCalendar];
        self.cal.timeZone = [NSTimeZone timeZoneWithName:@"GMT"];
        self.picker.calendar = self.cal;
        self.picker.timeZone = cal.timeZone;
    

    And here is the action method for the picker:

        -(IBAction)dpClick:(NSDatePicker *)sender {
        NSDateComponents *comps = [cal components:NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit fromDate:sender.objectValue];
        NSLog(@"hours=%ld  minutes=%ld  seconds=%ld",comps.hour,comps.minute,comps.second);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any component in Ext JS 4 similar to Flex view Stack? http://livedocs.adobe.com/flex/3/html/help.html?content=navigators_3.html
is there a reasonable way to access the view attribute passedArgs (or any similar)
Is there any way to view the reduction steps in haskell, i.e trace the
Is there any way to view what functions / code are attached to any
Using Eclipse, working with (ANSI) C language, is there any way to view the
Is there any way how to view all sent parameters if I do not
Is there any tool which gives you the view of current execution of you
Is there any way to set a background view on a UITableViewController? I try
Is there any possibility of creating a view like the following image? I do
Is there any way to achieve this effect (3D CANVAS VIEW) for displaying an

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.