LogoLogo
  • Introduction
    • 👋Overview
    • 🤷Target Audience
    • ✨Features
  • Getting started
    • đŸ–Ĩī¸System Requirements
    • đŸ“ĻInstallation
    • âš™ī¸Configuration
    • 🔧Setup Routine
  • Fundementals
    • 🎎Roles
    • 🌏Countries and time zones
    • â™ģī¸Scheduletask concept
    • 💰Payment Service Provider
    • âœī¸Administration
      • đŸ”ĩSales
        • đŸ‘ĨCustomers
        • đŸ“ĨInvoices
        • 📋Plans
        • 🧊Modules
      • đŸŸĸSystem
        • đŸŽ›ī¸System settings
        • â›“ī¸API Settings
        • 🌐Languages
        • đŸĒ™Currencies
        • đŸŗī¸Countries
        • 📂Mappings
        • đŸ’ŦTranslations
        • đŸĒ§Widgets
    • đŸ–ąī¸User guide
      • 🔐Customer rights
      • 🔗Customer Navigation
      • 📃Edit profile
      • 🔑Reset password
      • 🏨Edit company
      • ⚡Manage users
      • 👔Manage tenants
      • 📨View invoices
      • 💸Add payment method
      • đŸĒ§Manage plans
      • đŸ“ĻManage modules
      • 🔔Notifications
  • Development
    • đŸ› ī¸Local development
    • 📂Folder structure
      • đŸ—„ī¸Application.cfc
    • 💡Develop with saaster
      • 🎇General services
        • đŸ’ŧMappings and rigths management
        • â†Šī¸Redirects
        • 👤Customer specific sessions
        • ã€Ŋī¸Global variable "getCustomerData"
      • 🌐Global functions
        • âš™ī¸getTrans()
        • âš™ī¸getAlert()
        • âš™ī¸logWrite()
        • âš™ī¸getTime()
      • 🧊Developing the main application
      • đŸ“ĻDeveloping modules
  • API
    • âš’ī¸API: Get started
    • 📂Resources
      • 📄authenticate
      • 📄getCurrentModules
      • 📄getCurrentPlan
      • 📄getPlanFeatureSetting
Powered by GitBook
On this page
  1. Development
  2. Develop with saaster
  3. Global functions

getTime()

Global function getTime()

Saaster offers a ready-to-use function for each user's correct time zone.

Saaster sets the current time zone to UTC 0 by default. The getTime() function then converts the user's time based on their input or IP. This function is only available with a customer session.

Please always save your times to the database using the Lucee function now() and NOT with the SQL function NOW().

The component contains (among others) the following two functions:

  • utc2local

  • local2utc

If you now want to display the user's date and time (now) anywhere in the world, use this function:

lsDateFormat(getTime.utc2local(utcDate=now()));
lsTimeFormat(getTime.utc2local(utcDate=now()));

If you now want to display the date and time from a db entry, use this function:

lsDateFormat(getTime.utc2local(utcDate=qTable.theDate));
lsTimeFormat(getTime.utc2local(utcDate=qTable.theDate));

Reminder: The date and time in the database is stored in UTC 0.

PreviouslogWrite()NextDeveloping the main application

Last updated 2 years ago

💡
🌐
âš™ī¸