Real Software Forums
http://forums.realsoftware.com/

setting a date in a app
http://forums.realsoftware.com/viewtopic.php?f=10&t=47730
Page 1 of 1

Author:  minity42 [ Sun Apr 28, 2013 10:41 pm ]
Post subject:  setting a date in a app

hello everybody need a little help
in my app the today date loads when the app starts i would like for the
date to look like this (04/01/2013) but it loads like this (4/1/2013)
is there a way as the date is loaded the app can change it in the app
but not change the pc date setting

do i need to use left mid right of /
or something else

i have check forms did not see any thing but could of over looked some thing

Author:  Rivo [ Mon Apr 29, 2013 2:04 am ]
Post subject:  Re: setting a date in a app

maybe this work..

dim d as new date
dim a,b,c,e as string
a=str(d.Day)
b=str(d.Month)
c=str(d.Year)
e="/"
MsgBox str(a+e+b+e+c)




Regards,
Rivo

Author:  Markus Winter [ Mon Apr 29, 2013 2:13 am ]
Post subject:  Re: setting a date in a app

How the date is displayed depends on the computers date and time settings. Different countries use different formats too.

e.g. 12/2/1967 in USA vs. 2.12.1967 in Germany

If you want one fixed setting then you have to use something like Rivo's answer, but your users might not like that at all.

I personally think it might look very unprofessional. The one place where you can get away with one format is database entry where you would use the standard SQLdate format YYYY-MM-DD.

Author:  minity42 [ Mon Apr 29, 2013 9:15 pm ]
Post subject:  Re: setting a date in a app

thanks revo
for the nice code i have a place in an app the that will work good in thank again
Markus Winter yes you are right about unprofessional look but it is for me to use at my job
to keep track of loads that come in so if any body need to know about a load i can pull up
that load by date or name
yes it is a database app sorry
i have the date load on open for putting info in the database just trying make thing easy
sort by date is why i would like the date to look like this (04/01/2013) putting the "0" before the "4"
there maybe 25 loads on the same day or two loads so i type the date in and i have in the code list count
after i type the date in it get the load count

i think it will make it easy for me

thanks revo and Markus Winter

Author:  minity42 [ Mon Apr 29, 2013 9:55 pm ]
Post subject:  Re: setting a date in a app

thanks again for the help i got it to work like i need it to
revo i use you idea of your code to get what i needed

it may not be good coding but it works

this is what i did

if b = "1" then
b = "0"+ b
elseif b = "2" then
b = "0" + b
end if
date.text = str(b+e+a+e+c)

i did it for "a" and "b" and it worked fine
so thanks again

Author:  Markus Winter [ Tue Apr 30, 2013 2:00 am ]
Post subject:  Re: setting a date in a app

minity42 wrote:
but it is for me to use at my job

If it is just for yourself then why not simply set the computer's date format as you like it? I use a customized date format on my Mac.

Author:  minity42 [ Tue Apr 30, 2013 9:22 pm ]
Post subject:  Re: setting a date in a app

yes it is for me but it will be on a thumb drive at my work so i did not want to change any computer setting just make the app do it
i do see your point but sometimes i am on 2 computers so that is why it is on a thumb drive just pop it in the usb enter data pull it and go

i make asphalt for roads and we have 3 plants but i work at 2 of them not at the same time if one plant has work for it i go there

hope that clears it up a little
thanks

allso i have a problems the database app is made to load rsd files i am having problems getting the open dialog to open in the same folder as the database
i look in the LR played with the code in there but it still open the document folder and the app is not in there so what can i do

little help

Author:  timhare [ Tue Apr 30, 2013 10:28 pm ]
Post subject:  Re: setting a date in a app

Use OpenDialog instead of GetOpenFolderItem. It allows you to specify the initial directory.

Author:  minity42 [ Tue Apr 30, 2013 11:00 pm ]
Post subject:  Re: setting a date in a app

thanks for the help on this i was using the GetOpenFolderItem

i think that is all thanks everybody

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/