4D Newbie, time question

View: New views
4 Messages — Rating Filter:   Alert me  

4D Newbie, time question

by Jamie Byrne :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Bit of a 4D Newbie.

Suggest my code was

Case Of
: (Form event=On Load)
va:=Current Time
End Case

How would I take the current hour, minute and seconds and place into 3 different variables? This possible?

Thanks,
Jamie!

**********************************************************************
4D Basics hosted by 4D, Inc.                       http://www.4D.com/

Register for 4D Summit 2009 Today
Early Bird Pricing Ends August 28th - http://www.4D.com/summit

To Unsubscribe:                        mailto:4DBasics-off@...
**********************************************************************



Re: 4D Newbie, time question

by Luis Pineiros (4D, Inc.) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jamie,

You can try this:

C_TIME($time_h)
C_TEXT($timestring_t;$hours;$minutes;$seconds)

$time_h:=Current time

$timestring_t:=String($time_h)
$timestring_t:=Replace string($timestring_t;":";"")

$hours:=Substring($timestring_t;1;2)
$minutes:=Substring($timestring_t;3;2)
$seconds:=Substring($timestring_t;5;2)


Kind Regards,

Luis Pineiros
Technical Services Team Member
4D, Inc./www.4d.com

...............................................................
Register for 4D Summit 2009 Today
Early Bird Pricing Ends August 28th - http://www.4d.com/summit
...............................................................



Jamie Byrne wrote:

> Hello,
>
> Bit of a 4D Newbie.
>
> Suggest my code was
>
> Case Of
> : (Form event=On Load)
> va:=Current Time
> End Case
>
> How would I take the current hour, minute and seconds and place into 3 different variables? This possible?
>
> Thanks,
> Jamie!
>
> **********************************************************************
> 4D Basics hosted by 4D, Inc.                       http://www.4D.com/
>
> Register for 4D Summit 2009 Today
> Early Bird Pricing Ends August 28th - http://www.4D.com/summit
>
> To Unsubscribe:                        mailto:4DBasics-off@...
> **********************************************************************
>
>  

**********************************************************************
4D Basics hosted by 4D, Inc.                       http://www.4D.com/

Register for 4D Summit 2009 Today
Early Bird Pricing Ends August 28th - http://www.4D.com/summit

To Unsubscribe:                        mailto:4DBasics-off@...
**********************************************************************



Re: 4D Newbie, time question

by Douglas Davis-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You would use the function:  Time String - which returns the time in the
format of HH:MM:SS

`Add this below your time command
TextTime:=Time string(va)
Hours:=num(substring(TextTime;1;2))
Minutes:= num(substring(TextTime;4;2))
Seconds:= num(substring(TextTime;7;2))

This assumes you want the numeric equivalents and not just the text.
--
|  Douglas S. Davis - Information Systems Coordinator
|  Monical Pizza Corporation  (http://www.monicals.com)
| - - - - - - - - - -
|  815/937-1890 - Voice  .  .  .  815/937-9828 - Fax
--





**********************************************************************
4D Basics hosted by 4D, Inc.                       http://www.4D.com/

Register for 4D Summit 2009 Today
Early Bird Pricing Ends August 28th - http://www.4D.com/summit

To Unsubscribe:                        mailto:4DBasics-off@...
**********************************************************************



RE: 4D Newbie, time question

by Tim Penner (4D, Inc) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The example from the docs: http://www.4d.com/docs/CMU/CMU00178.HTM can be
changed slightly to do this...

  $vhNow:=Current time
   ALERT("Current hour is: "+String($vhNow\3600))
   ALERT("Current minute is: "+String(($vhNow\60)%60))
   ALERT("Current second is: "+String($vhNow%60))

Could be rewritten to be:

  $vhNow:=Current time
   $vHour := $vhNow\3600
   $vMinute := ($vhNow\60)%60
   $vSecond := ($vhNow%60)

Hope that helps,

Tim


-----Original Message-----
From: 4DBasics@... [mailto:4DBasics@...] On Behalf Of Jamie
Byrne
Sent: Tuesday, June 09, 2009 8:41 AM
To: 4DBasics@...
Subject: 4D Newbie, time question

Hello,

Bit of a 4D Newbie.

Suggest my code was

Case Of
: (Form event=On Load)
va:=Current Time
End Case

How would I take the current hour, minute and seconds and place into 3
different variables? This possible?

Thanks,
Jamie!

**********************************************************************
4D Basics hosted by 4D, Inc.                       http://www.4D.com/

Register for 4D Summit 2009 Today
Early Bird Pricing Ends August 28th - http://www.4D.com/summit

To Unsubscribe:                        mailto:4DBasics-off@...
**********************************************************************



**********************************************************************
4D Basics hosted by 4D, Inc.                       http://www.4D.com/

Register for 4D Summit 2009 Today
Early Bird Pricing Ends August 28th - http://www.4D.com/summit

To Unsubscribe:                        mailto:4DBasics-off@...
**********************************************************************