次の方法で共有


How to: Set Date, Time, and Currency Formats

To format dates, times, and currency, you can use a variety of formatting techniques. You can:

  • Allow Visual FoxPro to use the settings established in the Control Panel.

  • Specify a language or a specific format in the Visual FoxPro Options dialog box that you want to use.

  • Format dates, times, and currency information in code.

To set a format for dates, times, and currency

  1. From the Tools menu, choose Options, and then click the Regional tab.

  2. To use the settings made with the Windows Control Panel, choose Use system settings.

    -or-

    Choose a language or format for dates and times and then choose options for formatting currency and numbers.

    Note   If you choose the format Short or Long for the date format, you cannot specify any further options for the date format, and the settings are read from the Windows Control Panel.

  3. Choose OK to use the options for this session, or Set As Default to make the changes the default settings for this copy of Visual FoxPro.

You can also use the SET SYSFORMATS Command and SET DATE Command. As a rule, you would issue this command during the initialization of your application (for example, in the configuration file). The default for SET SYSFORMATS is OFF, so you must explicitly set it to ON when starting your application.

You can establish data validation in individual text boxes by setting the Format Property of the text box. Note that text box formatting takes precedence over system-wide formatting.

See Also

Concepts

How to: Enter International Data

Sorting Data in International Applications

Reference

Modifying International Applications

Other Resources

Code Pages in Visual FoxPro

Developing International Applications

Creating International Applications