Contents:

 

 

Introduction


News blog


What is Servoy?


Getting Started


Comparison Servoy/VFP


Performance


How-To's

 

Code Reference

 

VFP2Servoy Toolkit

 

 

Contact / feedback

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DATE() - new Date()



Returns the current system date, which is controlled by the operating system, or creates a Date value. You will have a tough time trying to find the Servoy equivalent for VFP's Date(). It works just a little different.

 

VFP code example

? DATE()  && returns date (2/18/2011) in format of regional settings
d = DATE(2012,10,15)  && new date = 10/15/2012 (OCTOBER!)

 

Servoy code example

var d = new Date();
application.output(d);  // Fri Feb 18 11:13:40 CET 2011
application
.output(d.toLocaleDateString());  // February 18, 2011
application.output(d.toDateString());        // Fri Feb 18 2011

utils.dateFormat(d,'d-M-yyyy');   // dutch date: 18-2-2011

// initialize a date value
var
d = new Date(2012,9,15);      // initialize a date value OCTOBER=9

// vfp2servoy toolkit
var d = globals.DATE(2012,10,15)  // initialize a date value OCTOBER=10

NOTE: Alternatively use globals.DATE() of the VFP2Servoy Toolkit

 

Conclusion:

When you are trying to get Servoy to handle the date in the same way that the DATE() function in Visual FoxPro does, you will have a hard time. It is not a problem to display the Full Datestring in the current locale and there are a million date/time functions but I did not find a way to get a short date-string in the users locale.

In Visual FoxPro there are two different datatypes for dates and datetimes, in Servoy there is only a datetime. This not a problem though. In fields Servoy shows a datetime calendar for datetime fields.

 

External resources:

 

vfp plugin

 

ServoyWorld 2012 pics

 

Official Servoy website

 

Ken Levy on Servoy

 

Servoy info

 

Servoy Forum

 

Servoy Documentation

 

VisualFoxpro.com © 2010-2012 • All rights reserved • Contact: info@visualfoxpro.com