Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Apr 27, 2017 9:24 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: setting a date in a app
PostPosted: Sun Apr 28, 2013 10:41 pm 
Offline

Joined: Wed Mar 02, 2011 3:41 pm
Posts: 31
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


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Mon Apr 29, 2013 2:04 am 
Offline

Joined: Tue Aug 29, 2006 4:04 am
Posts: 513
Location: Indonesia
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


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Mon Apr 29, 2013 2:13 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
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.


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Mon Apr 29, 2013 9:15 pm 
Offline

Joined: Wed Mar 02, 2011 3:41 pm
Posts: 31
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


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Mon Apr 29, 2013 9:55 pm 
Offline

Joined: Wed Mar 02, 2011 3:41 pm
Posts: 31
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


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Tue Apr 30, 2013 2:00 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
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.


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Tue Apr 30, 2013 9:22 pm 
Offline

Joined: Wed Mar 02, 2011 3:41 pm
Posts: 31
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


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Tue Apr 30, 2013 10:28 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Use OpenDialog instead of GetOpenFolderItem. It allows you to specify the initial directory.


Top
 Profile  
 
 Post subject: Re: setting a date in a app
PostPosted: Tue Apr 30, 2013 11:00 pm 
Offline

Joined: Wed Mar 02, 2011 3:41 pm
Posts: 31
thanks for the help on this i was using the GetOpenFolderItem

i think that is all thanks everybody


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group