Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Daniel Hofford
  Where is Daniel Hofford?
 Ocala
 Florida - United States
 Daniel Hofford
 Tags
Subject: RE: DATETIME()
Thread ID: 189004 Message ID: 189029 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Wednesday, August 13, 2008 2:49:26 AM         
   


> >
> > Since you needed only the time portion without the AM/PM, then you need to add more to what Andy has given u:
> >
> >
?LEFT(TTOC(DATETIME(),2),8)

> >
> > or
> >
> >
?LEFT(TIME(DATETIME()),8)

> >
> > Another is to go to the 24-hour formatting (military) so that AM/PM is no longer needed:
> >
> >
SET HOUR TO 24
> > ?TTOC(DATETIME(),2)

> >
> >
> > Jun Tangunan
> >
> > "Get out of the past and look in the future."
> > http://weblogs.foxite.com/sandstorm36/
>
> See Andy's message to me.
>
> Thanks
>
> Dan
> "Our gold does not chink and glitter. It gleams in the sun and neighs in the dark." Chief Joseph


I have seen it, and overlooked your question at the same time, thus the reason for using LEFT().

However, my second suggestion about SET HOURS TO will work for you. Try this, change your time in your systray to 10:52:27 PM without touching SET HOURS TO (default is 12). Then:
?TTOC( DateTime(), 2 )

It will give you exactly 10:52:27 PM. Isn't what your asking for is 22:52:27 instead? Then my second suggestion is what you needed:

SET HOURS TO 24
?TTOC(DATETIME(),2)


Result: 22:52:27, your required answer!

Jun Tangunan

"Get out of the past and look in the future."
http://weblogs.foxite.com/sandstorm36/

ENTIRE THREAD

DATETIME() Posted by Daniel Hofford @ 8/12/2008 10:57:18 PM
RE: DATETIME() Posted by Andy Kramek @ 8/12/2008 11:00:46 PM
RE: DATETIME() Posted by Daniel Hofford @ 8/13/2008 12:58:18 AM
RE: DATETIME() Posted by Andy Kramek @ 8/13/2008 11:54:50 AM
RE: DATETIME() Posted by Jun Tangunan @ 8/13/2008 12:28:31 AM
RE: DATETIME() Posted by Daniel Hofford @ 8/13/2008 12:58:53 AM
RE: DATETIME() Posted by Jun Tangunan @ 8/13/2008 2:49:26 AM
RE: DATETIME() Posted by Cetin Basoz @ 8/13/2008 12:23:39 PM
RE: DATETIME() Posted by Yousfi Benameur @ 8/13/2008 12:59:24 PM