Get Date Format

Get Date Format

Postby Jeff Barnes » Tue May 19, 2009 1:53 am

Hi,

Can someone please tell me how to get the date format?

What I would like to do is have a tooltip displayed when the user hovers over a date field showing them something like:

Format: mm/dd/yy
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Get Date Format

Postby hua » Tue May 19, 2009 2:24 am

I didn't test this but you can try something like,
Code: Select all  Expand view

#include "set.ch"
cDate := set(_SET_DATEFORMAT)
 
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Get Date Format

Postby Jeff Barnes » Tue May 19, 2009 12:57 pm

Thanks Hua.

That did it.

It appears that the date format does not match the settings in windows ... how can I do a SET DATE .... to match the windows date setting?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Get Date Format

Postby hua » Wed May 20, 2009 2:52 am

> It appears that the date format does not match the settings in windows
Yeap. It's based on what we set in our app via the command SET DATE command

> ... how can I do a SET DATE .... to match the windows date setting?
Sorry, no idea. Have never done that before.
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Get Date Format

Postby FranciscoA » Wed May 20, 2009 4:40 am

Jeff:
Is it what you want?
oDateSystem:cTooltip:=cMonth(dATE())+" "+StrZero(Day(dATE()),2)+" "+Str(Year(dATE()),4)
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Get Date Format

Postby Jeff Barnes » Wed May 20, 2009 12:13 pm

Actually what I want to do is to set the date in my app to match the settings in Windows Control Panel->regional and language options->Customize(button)->Date(tab)

I would like to match the "Short Date Format"
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 85 guests