INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Pervasive Time data field

Pervasive Time data field

(OP)
I'm not sure if this a pervasive feature but here it goes.
My company bought this application which uses pervasive as the backend. In the database one of the fields is a TIME field. But when I use Pervasive Control Center to examine the tables, some of the TIME Fields are saved as 7-digits numbers, i.e. "3352919" .
Is this how pervasive saved TIME fields ? If so, does anyone knows how to convert this number into a normal time fields, i.e "12:02 PM" ?

Thanks,
Scott

RE: Pervasive Time data field

Is the field defined as "Time" in the table (right click on the table as select "Edit Table Design")? Are some of the rows showing a correct time?  If so, check out the application that's creating the data. Make sure it's giving the proper data to Pervasvie.

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
Custom VB and Btrieve development.
http://www.mirtheil.com

RE: Pervasive Time data field

The time field is 4 bytes in length where four integers represents the following:
Hour is byte 4
Minute is byte 3
Second is byte 2
Hundredths of second is byte 1

So if a program reads this as a 4 byte integer then you will have a value that represents a long integer.  For example this number represents this time.
 287252224 = 17:31:31

Hope that helps.

Gil

RE: Pervasive Time data field

(OP)
thanks guys for you quik responses.
WE just contacted the vendor and they will send us the information about how they populate their TIME fields.

RE: Pervasive Time data field

(OP)
Here is the answer that I got from the vendor:

7 digit number = (Hours * 360000) + (Minutes * 6000) + (Seconds * 100).

Example:

Time: 09:18:50 (HH:MM:SS)
Number = 09 * 360000 + 18 * 6000 + 50 *100                  = 3353000

Data:
        Number = 7 digit long number = 3352919
        Hour    = Hours (HH from HH:MM:SS)
        Min     = Minutes (MM from HH:MM:SS
        Sec     = Seconds (SS from HH:MM:SS)

Steps to convert this number into actual time format.

1. Hour = Integer (Number / 360000)

Hour = Integer (3352919 / 360000) = 09

2. Number = Number - Hour * 360000

Number = 3352919 - 09 * 360000 = 112919

3. Min = Integer (Number / 6000)

Min = Integer (112919 / 6000) = 18

4. Number = Number - Min * 6000

Number = 112919  - 18 * 6000 = 4919

5. Sec = Integer (Number / 100)

Sec = Integer (4919/ 100) = 49

Output:
      Hour:Min:Sec = 09:18:49

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close