is_time


The is_time function determines if a string value is a time value like '04:35:14.45' or 04:35:14.45. Strings with enclosing ' ' are present in FITS image headers and are returned using CImage:KwdGetRaw.

Syntax

bResult = is_time( sString )

bullet.gif    sString is the string to test.

bullet.gif    bResult = true if the string is a time value.

bullet.gif    bResult = false if not a string.

Example

The script below evaluates several strings to test for time format:

str1 = "'04:35:14.45'"

-- time string with ' '

bTrue = is_time( str1 )

 

Printf("result = %s\n", booltostr(bTrue))

-- prints result = true

 

 

str2 = "04:35:14.45"

-- time string without ' '

bTrue = is_time( str2 )

 

Printf("result = %s\n", booltostr(bTrue))

-- prints result = true

 

 

str3 = "Johhny"

-- string, but not time

bTrue = is_time( str3 )

 

Printf("result = %s\n", booltostr(bTrue))

-- prints result = false

 

 

str4 = 4.45

-- not a string

bTrue = is_time( str4 )

 

Printf("result = %s\n", booltostr(bTrue))

-- prints result = false

Related Topics

time2num

is_datetime

booltostr

String Type Functions

 


Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.