Actual date and time

Hello to all,
There a way that when the user insert a record, it reflect the actual time where the record was inserted and show it later. There no problem showing it in a table, is just inserting. How can I do that?
Thanks

Hi,
There is a {{NOW}} binding available in server actions. You can use that in value part of insert step.

Or you could do this on database level, for example when using a mySql database you can add a timestamp field and use CURRENT_TIMESTAMP as a default value.

Hello to all,
Thanks for your suggestions. At the database level will not work for me, the field is used to place future appointment dates, can have the actual date. I want to show in a dashboard the appointments for the current date each day. At this moment I am placing the date directly in the server action and changing it every day. The NOW option in the server action, I tried it but is not working. I think is because of the format. In order to assign the date in the form, I use the date picker and is stored as MM-DD-YYYY. I need to do something with the field or change the format in order to make the NOW option to work?

The NOW option requires a date in the format which a database date field accepts.
What is the exact database field type you want to store NOW in?

Actually that field is a char in the database

So what is the exact problem? Can you explain a little more detailed?
And why using a char field to store dates?

If I use the NOW option in the server action in order to show in the dashboard the actual day appointments, is now showing it. There a form where the user enter the appointment data with the date of the appointment that is a future date. I want that when we are in the day of the appointment, show it in the dashboard and everybody knows what is on for today for example. I am showing it in the TV in the wall of the office

Can you explain this more please ... i am not sure i understand what are you referring to.
Maybe some screenshots will help as well.

Here is the screenshot. Basically, I have a form where the user place appointments for patients with the date that they have to go to the doctor. Also, I have a dashboard with the information of these patients and the date of the appointment. I have a computer connected to a TV in the wall in order to show to the administrative office the list of patients that need to go to the doctor today and then, the person in the office may call then and make sure that the patients are going their appointments. In that list in the dashboard, I want that change every day and show today’s appointments only. Actually, I am doing that by changing the date in the server action because for some reason if I use NOW, doesn’t show anything in the list.

Is the list in the right

And is NOW actually storing a value in the database?
Also, post a few screenshots of how are you inserting it exactly.

No, When the user place the info in the insert form with the appoinment use the date picker, then the date is stored.

[quote=“alexpr25, post:1, topic:38458, full:true”]
Hello to all,
There a way that when the user insert a record, it reflect the actual time where the record was inserted and show it later. There no problem showing it in a table, is just inserting. How can I do that?
Thanks
[/quote]

The date picker is “Fecha de Cita”

Sorry i am really lost from your explanation.
Can you once again explain what is the problem? You mention that NOW is not working, now you are referring to some date pickers.
What exactly your issue is here?

If you mean as a condition in the query, you could use
equals {{NOW.formatDate('yyyy-MM-dd')}}

or

between {{NOW.formatDate('yyyy-MM-dd 00:00:00')}} AND {{NOW.formatDate('yyyy-MM-dd 23:59:59')}}

NOW returns date AND time so if you just use NOW it will only match items that exactly match the date AND time of the query. The methods above either match just the date or the between 00:00:00 and 23:59:59 on that date.

Can I place that in the server action that I use in the patient list in the dashboard in order to show the patients that have appointments for today?

Use it in the Server Action as a condition for the query that generates the list.

Also, just realised you are using a CHAR field rather than date with format MM-DD-YYYY so use:

datefield equals {{NOW.formatDate('MM-dd-yyyy')}}