FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Get Date Format
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Get Date Format
Posted: Tue May 19, 2009 01:53 AM

Hi,

Can someone please tell me how to [u:dk0pwhol]get[/u:dk0pwhol] 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)
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Get Date Format
Posted: Tue May 19, 2009 02:24 AM
I didn't test this but you can try something like,
Code (fw): Select all Collapse
#include "set.ch"
cDate := set(_SET_DATEFORMAT)
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Get Date Format
Posted: 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)
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Get Date Format
Posted: Wed May 20, 2009 02: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
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Get Date Format
Posted: Wed May 20, 2009 04: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
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Get Date Format
Posted: 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)

Continue the discussion