Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Over write the system Regional Setting through PB

Status
Not open for further replies.

Sathmaha

Programmer
Aug 4, 2003
8
GB
Hi Pals,

I like to create a small function to check the Regional setting date format and overwrite the current one with my defined format through powerbuilder programming , is it possible ? If its please explain me .

Advance Thanks a Lot.


 
why do u want to check the settings ..just do as u want .
Below find few examples ....


Date fromdate
fromdate = today()
Messagebox('vulcanjena',string(fromdate))

RESULT --> MM/DD/YYYY

Datetime fromdate
fromdate = datetime(today())
Messagebox('vulcanjena',string(fromdate))

RESULT --> MM/DD/YYYY hh:mm:ss

Datetime fromdate , todate

fromdate = datetime(date(today()),time(0,0,0))
todate = datetime(date(today()),time(23,59,59))
Messagebox ('vulcanjena',string(fromdate))
Messagebox ('vulcanjena',string(todate))

RESULT --> MM/DD/YYYY 00:00:00 and MM/DD/YYYY 23:59:59


Enjoy .....




 
use GetLocaleInfoA() windows API fn to get user's regional date settings

and use SetLocaleInfoA() to set user's regional date settings

both these apis are in kernel32.dll
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top