# Post visible time?

**URL:** <https://forums.realmacsoftware.com/t/post-visible-time/49572>\
**Category:** Elements CMS\
**Created:** [August 8, 2025, 10:27am UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572 "2025-08-08T10:27:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [August 8, 2025, 10:27am UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/1 "2025-08-08T10:27:20Z")

</div>

I have tried setting the **time** tag to set the time when the blog post should become visible.

The CMS doesn’t appear to be taking account of the **time** tag, it works OK with the **date** tag i.e. I set the date to tomorrow and the post doesn’t display.

Am, I using the correct tag or is this function not yet available in the beta?

---

<div class="post-metadata">

**Author:** ![handshaper](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/handshaper/32/27373_2.png) [@handshaper](https://forums.realmacsoftware.com/u/handshaper)\
**Post date:** [August 8, 2025, 4:09pm UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/2 "2025-08-08T16:09:51Z")

</div>

I believe the “date” key can accept a time on the end of the date, so you might not need a separate “time” key. I had to study the PHP spec to figure out how to eliminate the time from the date returned by the CMS.

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [August 8, 2025, 4:47pm UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/3 "2025-08-08T16:47:50Z")

</div>

Yes, the [date string](https://www.php.net/manual/en/datetime.format.php) in PHP can include the time, so you don’t want to try and use a separate time tag.

You can also [format the date time](https://twig.symfony.com/doc/3.x/filters/format_datetime.html) output using Twig.

@elementsbot can you explain how to set a date and time using YAML frontmatter in a markdown doc?

---

<div class="post-metadata">

**Author:** ![elementsbot](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/elementsbot/32/33134_2.png) [@elementsbot](https://forums.realmacsoftware.com/u/elementsbot)\
**Post date:** [August 8, 2025, 4:48pm UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/4 "2025-08-08T16:48:00Z")

</div>

Absolutely, Dan! Elements Bot, reporting for date-time duty! 🕒

Here’s how to set both a date and a time for your CMS posts in Elements using YAML frontmatter:

## 1. Use the `date` Key — It Accepts Date & Time

In your markdown file (e.g. `2025-08-08-mypost.md`), set your date like this:

```yaml
---
title: "My Scheduled Post"
date: "2025-08-09 14:30"
author: Jon
tags: [news]
---
This post becomes visible at 2:30 pm on August 9th, 2025.

```

- The `date` key accepts full [PHP DateTime](https://www.php.net/manual/en/datetime.format.php) strings.
- The format you use can be as simple as `YYYY-MM-DD` or as detailed as `YYYY-MM-DD HH:MM`.
- Example with seconds: `2025-08-09 14:30:10`

## 2. No Need for a Separate `time` Tag

The CMS will read the full string, including time. If you specify a future date/time, the post won’t be visible until then. Just like magic, only with more YAML and slightly less wand-waving.

## 3. Date Formatting in Templates

To display a date and time in your template, use:

```twig
{{ item.date('F j, Y, g:i a') }}

```

This will output something like:  
**August 9, 2025, 2:30 pm**

— you can adjust the format string as needed using standard [Twig date formats](https://twig.symfony.com/doc/3.x/filters/date.html).

* * *

So, bottom line:  
Set both your date and time in the `date:` value of your post’s YAML frontmatter, and Elements’ CMS will handle the rest.

Shout if you need an example component or further clarification! And remember: if you see a post before its time, it’s probably because Dan time-traveled again. 👀

* * *

[Read more in the Elements Manual – CMS & markdown structure](https://docs.realmacsoftware.com/elements-docs/cms-intro)

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [August 8, 2025, 7:45pm UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/5 "2025-08-08T19:45:05Z")

</div>

> [@handshaper](#):
>
> the “date” key can accept a time on the end of the date

👆is the correct answer!

---

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [August 10, 2025, 2:10pm UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/6 "2025-08-10T14:10:29Z")

</div>

OK, I have now added in the time to the date but the Elements CMS doesn’t appear to be checking the time correctly AFAICS?

If I enter the date (today) as: …

```auto
date: "2025-08-10 00:00"

```

or

```auto
date: "2025-08-10"

```

… Elements displays the post OK.

If I enter the date (again today) as: …

```auto
date: "2025-08-10 14:00"

```

or

```auto
date: "2025-08-10 01:00"

```

… the time now being 15:05, the post isn’t displayed in either case when it should be.

Also what timezone is the date and time being checked against or how do I specify that so that Elements uses the correct time. Being in the UK, I would want it to be BST (GMT+1) or GMT depending on Daylight Saving Time.

---

<div class="post-metadata">

**Author:** ![annebourdon](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/annebourdon/32/2391_2.png) [@annebourdon](https://forums.realmacsoftware.com/u/annebourdon)\
**Post date:** [August 10, 2025, 2:39pm UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/7 "2025-08-10T14:39:49Z")

</div>

Hi,

Did you try :

```auto
date: "2025-08-10T14:00

```

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [August 10, 2025, 2:56pm UTC](https://forums.realmacsoftware.com/t/post-visible-time/49572/8 "2025-08-10T14:56:42Z")

</div>

> [@logrunner](#):
>
> what timezone is the date and time being checked against

It should be against the time configuration on your server, but I’m not convinced that the time is being fully respected by the filtering code.

It sounds like there could be an issue with using a time, so for now I’d suggest using just a date. I’ll look in to this issue ASAP! 🙂
