DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 16th January 2010
m1tk0 m1tk0 is offline
New User
 
Join Date: Jan 2010
Posts: 2
Thanked 0 Times in 0 Posts
Default REQUEST: Programm for changing the clock

Can anyone write me a program in BSD for changing the clock's format from 12 to 24 hours, like: 1:30pm - 13:30 and 14:20 - 2:30 pm
Reply With Quote
  #2   (View Single Post)  
Old 16th January 2010
m1tk0 m1tk0 is offline
New User
 
Join Date: Jan 2010
Posts: 2
Thanked 0 Times in 0 Posts
Default

ooohhh I mean VISUAL BASIC

Last edited by J65nko; 16th January 2010 at 11:34 AM. Reason: Swearing removed
Reply With Quote
  #3   (View Single Post)  
Old 16th January 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

I honestly have no idea what your second post meant, but I'll try my best at simplifying this for you.

Traditional UNIX kernels only know time as seconds passed since the UNIX epoch, internally the clock is set to UTC time, it is functions within the C library that convert time into your preferred timezone.. and format it into something more human readable (..not a scary integer).

If you're asking about the date(1) program, it allows you to specify custom formatting desires.. passing parameters onto a helpful little function in the C library, strftime(3).

The following demonstrates 12 hour time, in the format of hour:minutes:seconds and AM/PM notation.

$ date "+%r"

The '%r' option is standardized by POSIX, it is the equivalent of '%I:%M:%S %p'.

Is this adequate enough? or are you asking how to configure a desktop environment like GNOME or KDE to use 12 hour time?

Last edited by BSDfan666; 16th January 2010 at 08:14 AM.
Reply With Quote
  #4   (View Single Post)  
Old 16th January 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

On Windows use the appropriate control panel applet to change date/time formats under your regional settings; I run my XP machine using ISO standard time/date formats.

On UNIX, just use date or configure the clocklet on your desktop.


For all in between, just write a custom clock >_>.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Request for sh script for compressing files bgobs Programming 5 16th January 2010 07:20 PM
Request for guides milo974 General software and network 1 16th December 2009 06:42 PM
configure clock in xfce delboy FreeBSD General 7 3rd September 2008 06:36 PM
Request for Opinions: A secure way of sharing modules TerryP Off-Topic 2 10th August 2008 07:18 PM
can't set clock? carpman FreeBSD General 31 7th July 2008 11:26 PM


All times are GMT. The time now is 02:16 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick