New topic: 

Date question.

<http://forums.realsoftware.com/viewtopic.php?t=33851>

         Page 1 of 1
   [ 6 posts ]                 Previous topic | Next topic          Author  
Message        waveuponwave          Post subject: Date question.Posted: Tue 
May 18, 2010 11:06 pm                                 
Joined: Fri Jan 29, 2010 12:39 pm
Posts: 229
Location: Virginia U.S.A.                Can you convert a string date like 
2010-01-01 into date format? Thanks.      
_________________
RB2010r2 Pro on Win 7
I promise to help if I ever learn how to help myself.  
                             Top                 DaveS          Post subject: 
Re: Date question.Posted: Tue May 18, 2010 11:18 pm                             
    
Joined: Sun Aug 05, 2007 10:46 am
Posts: 2355
Location: San Diego, CA                Code:  dim d as new date
  dim s as string="2010-01-02"
  d.SQLDate=s
  msgbox d.LongDate
      
_________________
Dave Sisemore
MacPro, OSX 10.6.2 RB2009r5.1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top                waveuponwave          Post 
subject: Re: Date question.Posted: Tue May 18, 2010 11:23 pm                    
             
Joined: Fri Jan 29, 2010 12:39 pm
Posts: 229
Location: Virginia U.S.A.                Thanks. How do I get rid of the 
timestamp? I just want the date.      
_________________
RB2010r2 Pro on Win 7
I promise to help if I ever learn how to help myself.  
                             Top                 waveuponwave          Post 
subject: Re: Date question.Posted: Tue May 18, 2010 11:41 pm                    
             
Joined: Fri Jan 29, 2010 12:39 pm
Posts: 229
Location: Virginia U.S.A.                Is there any way to do this and keep 
it in date format without the timestamp? I can't use a string.

Code:  dim d as new date
  dim dd As New Date
  dim ss as string
  dim s as string="2010-01-02"
  d.SQLDate=s
  ss = replace(d.SQLDate, right(d.SQLDate, 0), "")
  msgbox str(d)      
_________________
RB2010r2 Pro on Win 7
I promise to help if I ever learn how to help myself.  
                             Top                 Blake          Post subject: 
Re: Date question.Posted: Tue May 18, 2010 11:57 pm                         
Joined: Fri Sep 30, 2005 8:39 pm
Posts: 351
Location: Arlington, TX                The date class always has an associated 
time (hour, minute, second) value. If you just want the date portion use 
d.ShortDate, d.LongDate or d.SQLDate      
_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Font (1.2), Texture (1.2), Mesh (1.5)  
                             Top                timhare          Post subject: 
Re: Date question.Posted: Wed May 19, 2010 12:07 am                         
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 7779
Location: Portland, OR  USA                dim d as new date
d.TotalSeconds = 0
d.SQLDate = "2010-01-02"   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 6 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to