Only the date value is returned when fetching the datetime field in Hubl.
If you run the `crm_object` function to get a CRM object instance that has a datetime field (DateTime Picker), it will only return the date instead of the date time.
{% set course= crm_object("COURSE", selectedCourseId, "start_date_time") %}
{{ shortCourse|tojson }}
// You would get instead of a timestamp or in a format with both date and time
{"start_date_time":"07/04/25"}
Hi @MLManifest and welcome, we are so glad to have you here!
Thanks for asking the HubSpot Community!
For information, here is the “HubL syntax overview”.
I’d love to invite our Top Experts to join this conversation: Hi @Anton, @Kevin-C and @Stephanie-OG when you are using HubL, do you also get the same result as @MLManifest? Do you have a workaround to have the date time to help @MLManifest, please?
Have a wonderful day and thanks so much! 
Bérangère
Hey @MLManifest,
When retrieving a datetime field using HubL’s crm_object function, it’s common to encounter a display that shows only the date portion, omitting the time. This behavior occurs because HubSpot’s templating engine, by default, formats datetime values to display only the date unless explicitly instructed otherwise.
To display both the date and time components, you can utilize the format_datetime filter in your HubL code.
{% set course = crm_object("COURSE", selectedCourseId, "start_date_time") %}
{{ format_datetime(course.start_date_time, "%B %e, %Y %I:%M %p", local_time_zone) }}
In this example:
- “%B %e, %Y %I:%M %p” formats the datetime to display the full month name, day of the month, year, and time in 12-hour format with AM/PM.
- local_time_zone ensures that the datetime is displayed in your account’s configured timezone. If you omit this parameter, the time will default to Coordinated Universal Time (UTC).
The format_datetime filter is the recommended approach, as the previously used datetimeformat filter has been deprecated.
Here is a previous community thread I found about date formatting - https://community.hubspot.com/t5/CMS-Development/HubDB-date-formatting/m-p/478944/highlight/true#M24494
Additional Resources: HubL Syntax - HubSpot docs
Regards,
Kosala
Thanks Kosala,
Unfortunately, that doesn’t work as the crm_objects function currently returns a plain string date. Below is the screenshot of the test I ran.

Okay, it seems the datetime is formatted to give only a date string when we run the `crm_object` function by default. We need to pass the argument for formatting (pass `false` ) to get the plain timestamp value.
{% set course= crm_object("COURSE", selectedCourseId, "start_date_time", false) %}
@MLManifest You’re correct in noting that the crm_object function in HubL returns formatted date strings by default. To retrieve the raw timestamp value, you can pass false as the fourth argument.
https://community.hubspot.com/t5/CMS-Development/HubL-displaying-different-date-values/td-p/970140
Thanks!