Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6746 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi all

I would like to create a script to calculate the time of day in order to display a "good morning," "good evening," "good afternoon" message. Has anyone seen a similar script out there?

Posted

You could do a calculation, I believe, unstored:

Case

(

Get(CurrentTime) >= "0:01" and Get(CurrentTime) <= "12:00" ; "Good Morning";

Get(CurrentTime) >= "12:01" and Get(CurrentTime) <= "5:00" ; "Good Afternoon";

Get(CurrentTime) >= "5:01" and Get(CurrentTime) <= "11:59" ; "Good Afternoon";

)

I think that should do it :

Posted

There are various methods you could use, and I don't know if you want to display a dialog or use a field or what, but here's one way of setting up the calc:

Let( [

noon = Time ( 12 ; 0 ; 0 ) ;

cocktail = Time ( 6 ; 0 ; 0 ) ;

now = Get ( CurrentTime ) ] ;

Case(

now < noon ; "good morning" ;

now < cocktail ; "good afternoon" ;

"good evening" ) )

This topic is 6746 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.