# Default value for Date/time global

**URL:** <https://forum.servoy.com/t/default-value-for-date-time-global/4172>\
**Category:** Classic Servoy\
**Created:** [May 6, 2005, 3:51pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172 "2005-05-06T15:51:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [May 6, 2005, 3:51pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/1 "2005-05-06T15:51:02Z")

</div>

Hi,

is it possible to set a default value for a Date/Time global variable, for example the current date?

I now entered now(), but that doesn’t seem to cut it.

Paul

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [May 6, 2005, 3:56pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/2 "2005-05-06T15:56:30Z")

</div>

I think it’s “now”…

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [May 6, 2005, 3:57pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/3 "2005-05-06T15:57:18Z")

</div>

Hi Paul,

The default values in fields (or globals) don’t “evaluate”. They are meant for hard-coded values (at this point).

Sorry!

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [May 6, 2005, 4:32pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/4 "2005-05-06T16:32:09Z")

</div>

Too bad… ![:?]( "Confused") I use a Global Date/Time variable in a relation and in Developer, the onSolutionLoad method is not fired when you switch from desigmode back to formview. And that’s where I set the value otherwise.

So now I get loads of calculations errors, since I have quite a few calculations based on this relation.

Now I have to always switch to formview on antoher form, click a button there that will fire the onsolutionLoad method and switch to the main form.

I can built in all kind of checks if the onSolutionLoad has been run allready and if not run it, but this complicates code a lot…

Paul

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [May 6, 2005, 4:40pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/5 "2005-05-06T16:40:06Z")

</div>

Then just put “now” in there…

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [May 6, 2005, 4:46pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/6 "2005-05-06T16:46:33Z")

</div>

Ha, thought Bob said it wasn’t possible. Works like a charm, tnx!

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [May 6, 2005, 4:49pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/7 "2005-05-06T16:49:43Z")

</div>

Bob meant that you cannot put a fancy function in there that would be evaluated. He probably thought you wanted to do that because you wrote “now()”…

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [May 6, 2005, 4:52pm UTC](https://forum.servoy.com/t/default-value-for-date-time-global/4172/8 "2005-05-06T16:52:20Z")

</div>

Probably, at least now my problem is solved ![:-)]( "Smile")
