PDA

View Full Version : 24h to 12h time and Hidden Window



DarknessX
30-04-2007, 08:50 PM
Well, quick question.. How do I get the current time, in HH:MM:SS form?
And the date in any form?
and the current day in the form of Monday, Tuesday, etc etc.

^^^^
Just need to convert time from 24 hour to 12 hour time.


And finally, how do I make a pascal window appear in the taskbar and NOT in the bar of programs? (above 3 q's more important :))

Traveler
30-04-2007, 10:27 PM
timeToStr(now()) returns current time
dateToStr(now()) returns current date
use DateTimeToString function to format in any way you like.

dayOfWeek(now()) returns number of day where sunday = 1 and saturday 7

Cant help you with the last question.

PS. we're happy to help you, but this info can also be found in less than 10 seconds using google (http://www.google.nl/search?hl=nl&q=dates+in+delphi&meta=). :)

DarknessX
30-04-2007, 11:29 PM
Well, I was using the FPC site's documentation, but I just couldn't get a variable assigned with the DD/MM/YY value and not the TDateTime value... But that was because I thought the 'format' was required, which your post just told me it isn't :D

So now I just need to find out how to hide windows... Like for example (probably not a pascal program...) but you know DU Meter? I need a program that runs in the background 24/7 like that, and having a bar on the bottom of the screen would just get in the way...

EDIT: Also, how do I make the time come in 12-hour time and not 24 hour time? I'm looking on the help site right now, but if anyone knows the answer, it'll be quicker :P

Ok, found that using am/pm as a time formatter, I can tell it to use 12 hour time, but how do I implement this to make it become equal to a variable in 12-hour form and not write it to screen?

seiferalmasy
01-05-2007, 11:00 AM
search this site also, I made a post soem time ago about the use of sysutils to do what you want.

Have a look at it;) The format function also works for making 24 hour/12 hout clock etc etc etc and was also mentioned on same thread.

DarknessX
02-05-2007, 01:46 AM
http://www.pascalgamedevelopment.com/viewtopic.php?t=4190&highlight=sysutils was the only post of yours I could find that covered that, and it didn't cover 24-12 hour time... Unless I'm missing something.