Jump to content

here's a wierd one with the TIME field!


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

Recommended Posts

I've got a field called DATE and another TIME - simple

I've got a button that updates these two fields using script

set field(DATE, Today)

set field(TIME, Today)

the date works perfectly

the time displays 205:20:49

Why? Does anyone know? The time field is field type TIME

Thanks guys/gals

Link to comment
Share on other sites

Hi Matt,

The O.A.M. is corrrect of course. Here's more background: FileMaker stores dates as integers representing the number of days since 1/0/01. December 3, 2001, then is 730,822.

FileMaker stores time data as integers representing a number of seconds. You will probably find that 730,822 seconds equals 203:00:22 (203 hrs, 00 min, 22 sec).

So the behavior you saw was simply that you were accidentally treating days (of a date) as seconds (of time).

Good luck!

Link to comment
Share on other sites

Don't use the Today function (read the FMP Help info to find out why). Use Status(CurrentDate) instead.

Today only does date. Was there a NOW function for time?

Link to comment
Share on other sites

quote:

Originally posted by Vaughan:

Don't use the Today function (read the FMP Help info to find out why). Use Status(CurrentDate) instead.

Today only does date. Was there a NOW function for time?

Read what Andy Lecates said. For time use StatusCurrentTime.

Link to comment
Share on other sites

Thanks guys - I forgot that with PC's it seems to work but Mac's are a different breed. On a database at my work I wrote a filemaker database which includes a diary service and I had used the Today function with no problem at all. On a Mac, for which I'm writing this new database, It probably deals with date and time differently with a different set of control codes away from DOS Time & Date.

Is it then adviseable to consider more cross platform approaches to things rather than hoping that any differences would be ironed out by filemaker? I mean, is there only 90% cross platform and 100% if you choose a better command?

Please also refer to my question in Portals Forum, This one still has me stumped. Cheers guys.

[ December 04, 2001: Message edited by: Matt Lightbourn ]

Link to comment
Share on other sites

Hi Matt,

quote:

Originally posted by Matt Lightbourn:

Thanks guys - I forgot that with PC's it seems to work but Mac's are a different breed. On a database at my work I wrote a filemaker database which includes a diary service and I had used the Today function with no problem at all. On a Mac, for which I'm writing this new database, It probably deals with date and time differently with a different set of control codes away from DOS Time & Date.

Is it then adviseable to consider more cross platform approaches to things rather than hoping that any differences would be ironed out by filemaker? I mean, is there only 90% cross platform and 100% if you choose a better command?

Please also refer to my question in Portals Forum, This one still has me stumped. Cheers guys.

[ December 04, 2001: Message edited by: Matt Lightbourn ]

I can almost guarantee that you did not use Today in FileMaker for Windows to return [correct] time data. FileMaker is consistent across platforms and has always serialized time and date data the same way, AFAIK.

Dates - a serial number representing duration in days (with 0 = January 0, 0001)

Time - a serial number representing duration in seconds (with 0 = 12:00am for time of day).

The Today function has been in FileMaker since before Status() functions were added. It is generally unpopular now, because it only updates at time of file launch (by FMP not FMS).

Since Status(CurrentDate) arrived, it is generally preferred by developers. It can be used in any calculation and will re-calculate whenever the calculation is performed. Note that stored/indexed calculations will not recalculate merely on a date change, so usually Status(CurrentDate) is used in unstored calculations that will recalculate whenever they are accessed.

Good luck,

Link to comment
Share on other sites

I have been using Today on PC Version but only with 50% success rate. My comments earlier were based upon thinking that perhaps macs and pc generate information slightly differently and that Current Status was just a Universal command to get the same result from both - if I am not accurate in this, then my seperation of the data processing formats and pc's are wrong and I apologise

Link to comment
Share on other sites

Eeeek, sorry I never meant to suggest using any function other than Status(CurrentTime) to get time information.

I was merely asking whether FMP had a NOW function. (I'm pretty sure it'd suffer the same problems that TODAY does.)

Link to comment
Share on other sites

Okay, we got that one sorted but, if Filemaker is running on the server, and because it is a perminently opened file, it doesn't seem to update to current date anyway! It seems to only know when it was originally opened. How do we deal with that one?

Cheers guys

Link to comment
Share on other sites

quote:

Originally posted by Matt Lightbourn:

Okay, we got that one sorted but, if Filemaker is running on the server, and because it is a perminently opened file, it doesn't seem to update to current date anyway! It seems to only know when it was originally opened. How do we deal with that one?

Cheers guys

I believe this may be covered in several places including the docs and in a TIL, but here is the gist of it.

At sometime after midnight, have the file on the server close, and then reopen. Thereafter the first guest to connect to it will cause the date to recalculate. If you have several hundred records this is not so bad. if you have half a million records, this is not a good idea.

You can have FIleMAker Pro--not FileMAker Server--recalculate the dates overnight on the server. Or. just avoid the TOday function altogether if you can.

HTH

Old Advance Man

Link to comment
Share on other sites

The calculation fields that use the Status(CurrentDate) and Status(CurrentTime) functions should be UNSTORED. That way they always re-calculate.

Avoid TODAY function like the plague. If you have used TODAY just replace it with the Status(CurrentDate) function, they are functionally equivilent in this regard.

Link to comment
Share on other sites

This topic is 7253 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
 Share

×
×
  • Create New...

Important Information

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