Date Format

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

Date Format

Post: # 1017Post Darren
Thu Jan 03, 2013 8:51 pm

Can anybody help?

I am having problems with Date$

Using FNX Basic if I use "SHOWMESSAGE DATE$" it gives me "1/3/2013"

I have tried vb script and the date is correctly shown as "03/01/2013"

My registry settings are correct eg shortdate = "dd/MM/yyyy"

Can anybody tell me what I am doing wrong?

Could this be a bug?

Thanks!!!!

Angel
Posts: 87
Joined: Sat Nov 19, 2011 9:34 am

Date Format

Post: # 1018Post Angel
Sun Jan 13, 2013 4:35 pm

I would do this. Maybe the problem is resolved.
`code
Declare SetLocaleInfo As  "SetLocaleInfoA" of "kernel32"
   Locale As Long
   LCType As Long
   lpLCData As String
End Declare
Const LOCAL_DEFAULT = &H2C0A
Const LOCALE_SSHORTDATE = &H1F
dim FMT_FECHA As String
FMT_FECHA = "dd/MM/yyyy"
Object frmForm As Form
  Caption="frmForm"
  center
  Object btnButton As Button
    Tag=0
    Top=10
    Left=10
    Caption="Button"
    Hint="This is a button"
    Showhint=True
    OnClick=button_OnClick
  End Object
Onshow=frmForm_Onshow
End Object
frmForm.Showmodal
`================================================================================
Sub frmForm_Onshow
  SetLocaleInfo.Locale=LOCAL_DEFAULT
  SetLocaleInfo.LCType=LOCALE_SSHORTDATE
  SetLocaleInfo.lpLCData=FMT_FECHA
  SetLocaleInfo.execute
End Sub
Sub button_OnClick
  Showmessage Date$
End Sub

Post Reply