Description
Formats a time value using U.S. English time formatting conventions.
Returns
A custom-formatted time value. If no mask is specified, returns a time value using the hh:nn tt format. For international time formatting, see LSTimeFormat.
Category
Date and time functions, Display and formatting functions
Function syntax
TimeFormat(time [, mask ])
See also
CreateTime, Now, ParseDateTime, LSTimeFormat, DateFormat
History
ColdFusion 10: The mask "m or M" for minute is deprecated. Recommended "n or N".
ColdFusion MX 6.1: Added the mask character L or l to represent milliseconds.
ColdFusion MX:
- Changed the way extra characters are processed: this function processes extra characters within the maskvalue differently than in earlier releases, as follows:
- ColdFusion 5 and earlier: the function returns the time format and an apostrophe-delimited list of the extra characters. For example, TimeFormat(Now(), "hh:mm:ss dog") returns 8:17:23 d'o'g .
- ColdFusion MX: the function returns the time format and the extra characters. For example, for the call above, it returns 8:17:23 dog.
If the extra characters are single-quoted (for example, hh:mm:ss 'dog'), ColdFusion 5 and ColdFusion MX return the time format and the extra characters: 8:17:23 dog.
- Added support for the following mask parameter options: short, medium, long, and full.
Parameters
Parameter |
Description |
|---|---|
time |
A date/time value or string to convert |
mask |
Masking characters that determine the format:
|
Usage
When passing a date/time value as a string, enclose it in quotation marks. Otherwise, it is interpreted as a number representation of a date/time object.Database query results for date and time values can vary in sequence and formatting unless you use functions to format the results. To ensure that dates and times display with appropriate formatting, and that users of your ColdFusion application are not confused by dates and times displayed, Adobe recommends that you use the DateFormat and TimeFormat functions to format date and time values from queries.
Example
<cfscript>
todaydate = Now();
writeOutput(TimeFormat(todaydate));
</cfscript>
Output
07:24 AM
Example of using masks z, Z, X, XX, and XXX
<cfscript>
writeoutput(timeFormat(now(), "hh:mm:ss, z"));
writeoutput(timeFormat(now(), "hh:mm:ss, Z"));
writeoutput(timeFormat(now(), "hh:mm:ss, X"));
writeoutput(timeFormat(now(), "hh:mm:ss, XX"));
writeoutput(timeFormat(now(), "hh:mm:ss, XXX"));
</cfscript>
Output
07:26:56, UTC
07:26:56, +0000
07:26:56, Z
07:26:56, Z
07:26:56, Z
Example of using masks k and K
<cfscript>
myDateTime = now();
WriteOutput(timeFormat(myDateTime,"hh:mm:ss,k" & "<br/>"));
WriteOutput(timeFormat(myDateTime,"hh:mm:ss,K" & "<br/>"));
</cfscript>
Output
07:28:27,7
07:28:27,7
Real-world uses of the TimeFormat function
Business hours and operating schedule management
A multi-location retail chain with 150+ stores operates across different time zones and needs to display accurate business hours for customers, manage employee schedules, and coordinate delivery windows. The system must handle varying store hours, holiday schedules, and regional differences while providing consistent, user-friendly time displays.
What it solves:
- Raw time data from databases appears in various formats
- Inconsistent time formatting leads to missed appointments and poor customer experience
- Different stores have different operating hours and formats
- Staff schedules need clear, readable time formats for shift management
- Website and mobile apps need consistent time displays
<cfscript>
// Simple Business Hours Display with TimeFormat
// Business: Multi-location retail with customer-friendly operating hours display
// Store locations with operating hours (from database)
storeLocations = [
{
"storeName": "Downtown Main Store",
"openTime": "08:00:00",
"closeTime": "22:00:00",
"phoneNumber": "(555) 123-4567"
},
{
"storeName": "Westfield Mall Location",
"openTime": "10:00:00",
"closeTime": "21:00:00",
"phoneNumber": "(555) 234-5678"
},
{
"storeName": "Airport Terminal Store",
"openTime": "06:30:00",
"closeTime": "23:30:00",
"phoneNumber": "(555) 345-6789"
}
];
// Function to check if store is currently open
function isStoreOpen(openTime, closeTime) {
local.currentTime = TimeFormat(Now(), "HH:nn");
local.storeOpen = TimeFormat(ParseDateTime(openTime), "HH:nn");
local.storeClose = TimeFormat(ParseDateTime(closeTime), "HH:nn");
return (local.currentTime GTE local.storeOpen AND local.currentTime LTE local.storeClose);
}
// Function to get next opening time
function getNextOpenTime(openTime, isOpen) {
if (isOpen) {
return "Currently Open";
} else {
return "Opens at " & TimeFormat(ParseDateTime(openTime), "h:nn tt");
}
}
</cfscript>
<cfoutput>
<h1>🏢 TimeFormat: Business Hours Display Demo</h1>
<p><strong>Business Need:</strong> Display store hours in customer-friendly formats across all channels</p>
<p><strong>Challenge:</strong> Raw database times (24-hour format) are not user-friendly</p>
<p><strong>Solution:</strong> Use TimeFormat() to convert times to appropriate display formats</p>
<p><strong>Current Time:</strong> <span style="color: blue; font-weight: bold;">#TimeFormat(Now(), "h:nn:ss tt")#</span></p>
<hr>
<h2>Store Locations & Hours</h2>
</cfoutput>
<cfloop array="#storeLocations#" index="store">
<cfscript>
// Check if store is currently open
storeIsOpen = isStoreOpen(store["openTime"], store["closeTime"]);
// Format hours for different contexts
websiteHours = TimeFormat(store["openTime"], "h:nn tt") & " - " & TimeFormat(store["closeTime"], "h:nn tt");
mobileHours = TimeFormat(store["openTime"], "h:nn tt") & " - " & TimeFormat(store["closeTime"], "h:nn tt");
employeeSchedule = TimeFormat(store["openTime"], "HH:nn") & " - " & TimeFormat(store["closeTime"], "HH:nn");
// Get status message
statusMessage = getNextOpenTime(store["openTime"], storeIsOpen);
</cfscript>
<cfoutput>
<div style="background: #storeIsOpen ? '##d4edda' : '##fff3cd'#; padding: 20px; margin: 15px 0; border-radius: 8px; border-left: 5px solid #storeIsOpen ? '##28a745' : '##ffc107'#;">
<h3>#store["storeName"]#</h3>
<p><strong>Phone:</strong> #store["phoneNumber"]#</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 15px 0;">
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h4>🌐 Website Display</h4>
<p style="font-size: 1.3em; color: ##007bff; font-weight: bold;">#websiteHours#</p>
<p><em>Customer-friendly 12-hour format</em></p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h4>📱 Mobile App</h4>
<p style="font-size: 1.3em; color: ##28a745; font-weight: bold;">#mobileHours#</p>
<p><em>Compact format for small screens</em></p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h4>👥 Employee Schedule</h4>
<p style="font-size: 1.3em; color: ##6f42c1; font-weight: bold;">#employeeSchedule#</p>
<p><em>24-hour format for staff clarity</em></p>
</div>
</div>
<div style="background: rgba(255,255,255,0.7); padding: 15px; border-radius: 5px; margin-top: 15px;">
<cfif storeIsOpen>
<p style="color: green; font-weight: bold; font-size: 1.1em;">
✅ OPEN NOW - Closes at #TimeFormat(store["closeTime"], "h:nn tt")#
</p>
<p>🛒 <em>Visit us today for great deals and excellent service!</em></p>
<cfelse>
<p style="color: orange; font-weight: bold; font-size: 1.1em;">
🔒 CURRENTLY CLOSED - #statusMessage#
</p>
<p>📞 <em>Call us during business hours or visit our website anytime!</em></p>
</cfif>
</div>
</div>
</cfoutput>
</cfloop>
<cfscript>
// Calculate store statistics
totalStores = ArrayLen(storeLocations);
openStores = 0;
for (location in storeLocations) {
if (isStoreOpen(location["openTime"], location["closeTime"])) {
openStores++;
}
}
// Sample special hours (holidays, events)
specialHours = [
{"date": "Black Friday", "hours": "06:00:00 - 23:59:59"},
{"date": "Christmas Eve", "hours": "08:00:00 - 18:00:00"},
{"date": "New Year's Day", "hours": "12:00:00 - 20:00:00"}
];
</cfscript>
<cfoutput>
<h2>📊 Store Status Summary</h2>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0;">
<div style="background: ##e8f5e8; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Total Stores</h3>
<h2 style="color: blue;">#totalStores#</h2>
</div>
<div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Currently Open</h3>
<h2 style="color: green;">#openStores#</h2>
</div>
<div style="background: ##fff3cd; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Closed Now</h3>
<h2 style="color: orange;">#totalStores - openStores#</h2>
</div>
</div>
<h2>🎯 Special Hours & Events</h2>
<div style="background: ##e3f2fd; padding: 20px; border-radius: 8px; margin: 20px 0;">
<h3>Upcoming Special Operating Hours:</h3>
<cfloop array="#specialHours#" index="special">
<cfscript>
// Parse and format special hours
hoursParts = ListToArray(special["hours"], " - ");
if (ArrayLen(hoursParts) EQ 2) {
openSpecial = TimeFormat(ParseDateTime(hoursParts[1]), "h:nn tt");
closeSpecial = TimeFormat(ParseDateTime(hoursParts[2]), "h:nn tt");
formattedSpecialHours = openSpecial & " - " & closeSpecial;
} else {
formattedSpecialHours = special["hours"];
}
</cfscript>
<div style="background: white; padding: 15px; margin: 10px 0; border-left: 4px solid ##007bff; border-radius: 5px;">
<h4>#special["date"]#</h4>
<p style="font-size: 1.2em; color: ##007bff; font-weight: bold;">#formattedSpecialHours#</p>
<p><em>All locations will follow these special hours</em></p>
</div>
</cfloop>
</div>
</cfoutput>
Event management and appointment scheduling
A comprehensive event management platform serves 10,000+ businesses organizing conferences, webinars, medical appointments, and professional services. The system handles global events across multiple time zones, manages complex scheduling requirements, and provides seamless booking experiences for millions of users worldwide.
What it solves:
- Events span multiple time zones requiring accurate time conversion and display
- Participants need clear, unambiguous event times in their preferred format
- Business contexts require different time format standards
- Export functionality needs standardized time formats for calendar applications
<cfscript>
// Simple Event Scheduling with TimeFormat
// Business: Professional appointment booking and event management system
// Today's scheduled events/appointments
todaysEvents = [
{
"eventTitle": "Medical Consultation - Dr. Smith",
"startTime": "09:30:00",
"duration": 30,
"clientName": "Sarah Johnson",
"type": "Medical"
},
{
"eventTitle": "Project Strategy Meeting",
"startTime": "14:15:00",
"duration": 90,
"clientName": "Tech Corp Team",
"type": "Business"
},
{
"eventTitle": "Webinar: Digital Marketing Trends",
"startTime": "16:00:00",
"duration": 60,
"clientName": "Global Audience",
"type": "Webinar"
},
{
"eventTitle": "Customer Support Training",
"startTime": "11:00:00",
"duration": 45,
"clientName": "Support Team",
"type": "Training"
}
];
// Function to calculate end time
function calculateEndTime(startTime, durationMinutes) {
local.startObj = ParseDateTime(startTime);
local.endObj = DateAdd("n", durationMinutes, local.startObj);
return local.endObj;
}
// Function to get event status based on current time
function getEventStatus(startTime, duration) {
local.now = Now();
local.startObj = ParseDateTime(startTime);
local.endObj = DateAdd("n", duration, local.startObj);
if (local.now LT local.startObj) {
return "Upcoming";
} else if (local.now GTE local.startObj AND local.now LTE local.endObj) {
return "In Progress";
} else {
return "Completed";
}
}
// Function to get time until event
function getTimeUntilEvent(startTime) {
local.now = Now();
local.startObj = ParseDateTime(startTime);
local.diffMinutes = DateDiff("n", local.now, local.startObj);
if (local.diffMinutes GT 60) {
return Int(local.diffMinutes / 60) & " hours " & (local.diffMinutes MOD 60) & " minutes";
} else if (local.diffMinutes GT 0) {
return local.diffMinutes & " minutes";
} else {
return "Started";
}
}
</cfscript>
<cfoutput>
<h1>📅 TimeFormat: Event Scheduling & Appointments Demo</h1>
<p><strong>Business Need:</strong> Professional event scheduling with clear time displays for all stakeholders</p>
<p><strong>Challenge:</strong> Different contexts require different time formats for optimal user experience</p>
<p><strong>Solution:</strong> Use TimeFormat() to present times appropriately for each audience</p>
<p><strong>Current Time:</strong> <span style="color: blue; font-weight: bold;">#TimeFormat(Now(), "h:nn:ss tt")#</span></p>
<hr>
<h2>Today's Event Schedule</h2>
</cfoutput>
<cfloop array="#todaysEvents#" index="event">
<cfscript>
// Calculate event details
endTime = calculateEndTime(event["startTime"], event["duration"]);
eventStatus = getEventStatus(event["startTime"], event["duration"]);
timeUntil = getTimeUntilEvent(event["startTime"]);
// Format times for different contexts
invitationTime = TimeFormat(event["startTime"], "h:nn tt");
calendarTime = TimeFormat(event["startTime"], "HH:nn");
reminderTime = TimeFormat(event["startTime"], "h:nn tt");
endTimeFormatted = TimeFormat(endTime, "h:nn tt");
// Set status styling
statusClass = "";
statusIcon = "";
switch(eventStatus) {
case "Upcoming":
statusClass = "##fff3cd";
statusIcon = "⏳";
break;
case "In Progress":
statusClass = "##d4edda";
statusIcon = "▶️";
break;
case "Completed":
statusClass = "##e2e3e5";
statusIcon = "✅";
break;
}
</cfscript>
<cfoutput>
<div style="background: #statusClass#; padding: 20px; margin: 15px 0; border-radius: 8px; border-left: 5px solid ##007bff;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
<h3 style="margin: 0;">#event["eventTitle"]#</h3>
<span style="background: white; padding: 5px 15px; border-radius: 15px; font-weight: bold;">
#statusIcon# #eventStatus#
</span>
</div>
<p><strong>Client/Attendee:</strong> #event["clientName"]# | <strong>Type:</strong> #event["type"]# | <strong>Duration:</strong> #event["duration"]# minutes</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 15px 0;">
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h4>📧 Email Invitation</h4>
<p style="font-size: 1.3em; color: ##007bff; font-weight: bold;">#invitationTime# - #endTimeFormatted#</p>
<p><em>User-friendly 12-hour format</em></p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h4>📱 Mobile Reminder</h4>
<p style="font-size: 1.3em; color: ##28a745; font-weight: bold;">#reminderTime#</p>
<p><em>Compact notification format</em></p>
</div>
<div style="background: white; padding: 15px; border-radius: 5px; text-align: center;">
<h4>🗓️ Calendar Export</h4>
<p style="font-size: 1.3em; color: ##6f42c1; font-weight: bold;">#calendarTime# - #TimeFormat(endTime, "HH:nn")#</p>
<p><em>24-hour format for calendar apps</em></p>
</div>
</div>
<div style="background: rgba(255,255,255,0.7); padding: 15px; border-radius: 5px;">
<cfif eventStatus EQ "Upcoming">
<p style="color: ##856404; font-weight: bold;">
⏰ <strong>Starts in #timeUntil#</strong>
</p>
<p>📱 <em>Mobile Reminder: "#event["eventTitle"]# starts at #reminderTime#"</em></p>
<cfelseif eventStatus EQ "In Progress">
<p style="color: ##155724; font-weight: bold;">
🔴 <strong>Currently in session until #endTimeFormatted#</strong>
</p>
<p>💼 <em>Meeting in progress - do not disturb</em></p>
<cfelse>
<p style="color: ##6c757d; font-weight: bold;">
✅ <strong>Event completed successfully</strong>
</p>
<p>📝 <em>Follow-up actions and notes can be added</em></p>
</cfif>
</div>
</div>
</cfoutput>
</cfloop>
<cfscript>
// Calculate event statistics
totalEvents = ArrayLen(todaysEvents);
upcomingEvents = 0;
inProgressEvents = 0;
completedEvents = 0;
for (eventItem in todaysEvents) {
status = getEventStatus(eventItem["startTime"], eventItem["duration"]);
switch(status) {
case "Upcoming": upcomingEvents++; break;
case "In Progress": inProgressEvents++; break;
case "Completed": completedEvents++; break;
}
}
// Sample appointment booking slots for tomorrow
availableSlots = [
"09:00:00", "09:30:00", "10:00:00", "10:30:00",
"14:00:00", "14:30:00", "15:00:00", "15:30:00", "16:00:00"
];
</cfscript>
<cfoutput>
<h2>📊 Event Status Dashboard</h2>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0;">
<div style="background: ##e8f5e8; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Total Events</h3>
<h2 style="color: blue;">#totalEvents#</h2>
</div>
<div style="background: ##fff3cd; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Upcoming</h3>
<h2 style="color: orange;">#upcomingEvents#</h2>
</div>
<div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 8px;">
<h3>In Progress</h3>
<h2 style="color: green;">#inProgressEvents#</h2>
</div>
<div style="background: ##e2e3e5; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Completed</h3>
<h2 style="color: gray;">#completedEvents#</h2>
</div>
</div>
<h2>📅 Available Appointment Slots (Tomorrow)</h2>
<div style="background: ##e3f2fd; padding: 20px; border-radius: 8px;">
<h3>Book Your Next Appointment:</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 15px 0;">
<cfloop array="#availableSlots#" index="slot">
<cfscript>
customerSlot = TimeFormat(slot, "h:nn tt");
adminSlot = TimeFormat(slot, "HH:nn");
</cfscript>
<div style="background: white; padding: 10px; text-align: center; border: 2px solid ##007bff; border-radius: 5px; cursor: pointer;">
<p style="margin: 5px 0; font-weight: bold; color: ##007bff;">#customerSlot#</p>
<p style="margin: 5px 0; font-size: 0.8em; color: ##6c757d;">(#adminSlot#)</p>
</div>
</cfloop>
</div>
<p style="background: ##f8f9fa; padding: 10px; border-radius: 5px; margin-top: 15px;">
<strong>Booking Confirmation:</strong> "Your appointment is scheduled for [selected time] tomorrow. You will receive a reminder 1 hour before your appointment."
</p>
</div>
</cfoutput>
eCommerce order management and delivery scheduling
A high-volume e-commerce platform processing 100,000+ orders daily manages order timestamps, delivery scheduling, customer communications, and logistics coordination. The system handles same-day delivery, scheduled deliveries, pickup times, and international shipping while providing customers with clear, accurate time information throughout their shopping experience.
What it solves:
- Shoppers demand precise delivery time windows and order status updates
- Delivery partners require standardized time formats for route optimization
- Global customers need time displays in familiar formats
- Real-time order status requires consistent time formatting across all touchpoints
<!--- Simple TimeFormat Demo: E-Commerce Order Management --->
<cfscript>
// Sample order data
orderData = [
{"orderId": "ORD-001", "customerName": "Sarah Johnson", "orderTime": "08:15:30", "deliveryTime": "17:00:00", "status": "Processing"},
{"orderId": "ORD-002", "customerName": "Mike Brown", "orderTime": "11:45:15", "deliveryTime": "15:30:00", "status": "Out for Delivery"},
{"orderId": "ORD-003", "customerName": "Lisa Chen", "orderTime": "09:22:00", "deliveryTime": "19:00:00", "status": "Delivered"}
];
// Available delivery slots
timeSlots = ["09:00:00", "12:00:00", "15:00:00", "18:00:00"];
</cfscript>
<h1>🛒 TimeFormat: E-Commerce Order Management</h1>
<cfoutput>
<p><strong>Current Time:</strong> #TimeFormat(Now(), "h:nn:ss tt")#</p>
<hr>
<h2>📦 Order Processing Dashboard</h2>
<!--- Order 1 --->
<div style="background: ##f8f9fa; padding: 20px; margin: 15px 0; border-radius: 8px; border-left: 4px solid ##007bff;">
<h3>Order #orderData[1]["orderId"]#</h3>
<p><strong>Customer:</strong> #orderData[1]["customerName"]#</p>
<p><strong>Status:</strong> #orderData[1]["status"]#</p>
<hr>
<h4>📧 Customer Email Format:</h4>
<p style="background: ##e7f3ff; padding: 10px; border-radius: 5px;">
"Your order was placed at <strong>#TimeFormat(orderData[1]["orderTime"], "h:nn tt")#</strong> and will be delivered by <strong>#TimeFormat(orderData[1]["deliveryTime"], "h:nn tt")#</strong>."
</p>
<h4>🚛 System Logistics Format:</h4>
<p style="background: ##fff3e0; padding: 10px; border-radius: 5px;">
"Order timestamp: <strong>#TimeFormat(orderData[1]["orderTime"], "HH:nn:ss")#</strong> | Delivery ETA: <strong>#TimeFormat(orderData[1]["deliveryTime"], "HH:nn")#</strong>"
</p>
<h4>📱 Mobile App Format:</h4>
<p style="background: ##f3e5f5; padding: 10px; border-radius: 5px;">
"Ordered: <strong>#TimeFormat(orderData[1]["orderTime"], "h:nn tt")#</strong> → Arriving: <strong>#TimeFormat(orderData[1]["deliveryTime"], "h:nn tt")#</strong>"
</p>
</div>
<!--- Order 2 --->
<div style="background: ##f8f9fa; padding: 20px; margin: 15px 0; border-radius: 8px; border-left: 4px solid ##007bff;">
<h3>Order #orderData[2]["orderId"]#</h3>
<p><strong>Customer:</strong> #orderData[2]["customerName"]#</p>
<p><strong>Status:</strong> #orderData[2]["status"]#</p>
<hr>
<h4>📧 Customer Email Format:</h4>
<p style="background: ##e7f3ff; padding: 10px; border-radius: 5px;">
"Your order was placed at <strong>#TimeFormat(orderData[2]["orderTime"], "h:nn tt")#</strong> and will be delivered by <strong>#TimeFormat(orderData[2]["deliveryTime"], "h:nn tt")#</strong>."
</p>
<h4>🚛 System Logistics Format:</h4>
<p style="background: ##fff3e0; padding: 10px; border-radius: 5px;">
"Order timestamp: <strong>#TimeFormat(orderData[2]["orderTime"], "HH:nn:ss")#</strong> | Delivery ETA: <strong>#TimeFormat(orderData[2]["deliveryTime"], "HH:nn")#</strong>"
</p>
<h4>📱 Mobile App Format:</h4>
<p style="background: ##f3e5f5; padding: 10px; border-radius: 5px;">
"Ordered: <strong>#TimeFormat(orderData[2]["orderTime"], "h:nn tt")#</strong> → Arriving: <strong>#TimeFormat(orderData[2]["deliveryTime"], "h:nn tt")#</strong>"
</p>
</div>
<!--- Order 3 --->
<div style="background: ##f8f9fa; padding: 20px; margin: 15px 0; border-radius: 8px; border-left: 4px solid ##007bff;">
<h3>Order #orderData[3]["orderId"]#</h3>
<p><strong>Customer:</strong> #orderData[3]["customerName"]#</p>
<p><strong>Status:</strong> #orderData[3]["status"]#</p>
<hr>
<h4>📧 Customer Email Format:</h4>
<p style="background: ##e7f3ff; padding: 10px; border-radius: 5px;">
"Your order was placed at <strong>#TimeFormat(orderData[3]["orderTime"], "h:nn tt")#</strong> and will be delivered by <strong>#TimeFormat(orderData[3]["deliveryTime"], "h:nn tt")#</strong>."
</p>
<h4>🚛 System Logistics Format:</h4>
<p style="background: ##fff3e0; padding: 10px; border-radius: 5px;">
"Order timestamp: <strong>#TimeFormat(orderData[3]["orderTime"], "HH:nn:ss")#</strong> | Delivery ETA: <strong>#TimeFormat(orderData[3]["deliveryTime"], "HH:nn")#</strong>"
</p>
<h4>📱 Mobile App Format:</h4>
<p style="background: ##f3e5f5; padding: 10px; border-radius: 5px;">
"Ordered: <strong>#TimeFormat(orderData[3]["orderTime"], "h:nn tt")#</strong> → Arriving: <strong>#TimeFormat(orderData[3]["deliveryTime"], "h:nn tt")#</strong>"
</p>
</div>
<h2>📊 Simple Analytics</h2>
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 20px 0;">
<div style="background: ##e8f5e8; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Total Orders</h3>
<h2 style="color: blue;">#ArrayLen(orderData)#</h2>
</div>
<div style="background: ##fff3cd; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Processing</h3>
<h2 style="color: orange;">1</h2>
</div>
<div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 8px;">
<h3>Delivered</h3>
<h2 style="color: green;">1</h2>
</div>
</div>
<h2>📅 Available Time Slots</h2>
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 20px 0;">
<div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 8px;">
<p style="font-weight: bold; margin: 0;">#TimeFormat(timeSlots[1], "h:nn tt")#</p>
<p style="margin: 5px 0; font-size: 0.9em;">Available</p>
</div>
<div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 8px;">
<p style="font-weight: bold; margin: 0;">#TimeFormat(timeSlots[2], "h:nn tt")#</p>
<p style="margin: 5px 0; font-size: 0.9em;">Available</p>
</div>
<div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 8px;">
<p style="font-weight: bold; margin: 0;">#TimeFormat(timeSlots[3], "h:nn tt")#</p>
<p style="margin: 5px 0; font-size: 0.9em;">Available</p>
</div>
<div style="background: ##d4edda; padding: 15px; text-align: center; border-radius: 8px;">
<p style="font-weight: bold; margin: 0;">#TimeFormat(timeSlots[4], "h:nn tt")#</p>
<p style="margin: 5px 0; font-size: 0.9em;">Available</p>
</div>
</div>
</cfoutput>
