<p>For a specific kind of entry I need the time in a date/time field to either automatically display as 23:00/11pm on the user dashboard, or, permanently set the time on that date/time field to 23:00/11pm.</p>

CC BY-SA 4.0
2020-06-11T08:15:59.083Z
So, you want that field to have 11pm as default value if nothing was set?
Johannes
CC BY-SA 4.0
2020-06-12T18:34:04.553Z
@Johannes Yes, exactly :)
JJefferyDev
CC BY-SA 4.0
2020-06-15T10:07:32.230Z
Maybe you can use this plugin: `doublesecretagency/craft-cpjs`. Then target your field and change its value on load using JavaScript. Not the cleanest, but probably the easiest.
Romain P.
CC BY-SA 4.0
2020-06-15T21:07:18.630Z
Yes, you could do this by injecting JS and manipulate the `<input>` or by writing a custom module that modifies the value. Do you need further advice on that?
Johannes
<craft3><datetime>
How to automatically set time in a date/time field?
# How to automatically set time in a date/time field?

(Asked by: username_0 on 2020-06-11)

For a specific kind of entry I need the time in a date/time field to either automatically display as 23:00/11pm on the user dashboard, or, permanently set the time on that date/time field to 23:00/11pm.

**Tags:** craft3, datetime
> **Comments:**
> **username_1**: So, you want that field to have 11pm as default value if nothing was set?  
> **username_0**: @Johannes Yes, exactly :)  
> **username_2**: Maybe you can use this plugin: `doublesecretagency/craft-cpjs`. Then target your field and change its value on load using JavaScript. Not the cleanest, but probably the easiest.  
> **username_1**: Yes, you could do this by injecting JS and manipulate the `<input>` or by writing a custom module that modifies the value. Do you need further advice on that?  

---

## 0 answers

