Cory Posted January 24, 2009 Report Share Posted January 24, 2009 I can't believe I missed this before but am I crazy or is there no way to set a date var from a file? Quote Link to comment Share on other sites More sharing options...
joe Posted January 25, 2009 Report Share Posted January 25, 2009 I can't believe I missed this before but am I crazy or is there no way to set a date var from a file?What is meant by "from a file"? Quote Link to comment Share on other sites More sharing options...
Cory Posted January 25, 2009 Author Report Share Posted January 25, 2009 I want a date variable set from one of the dates of a file. Like Variable Set From File - Get File Date/Time and Ive decided it doesn't exist. EG count all the files in a folder that have aged over 5 work days. This was something I complained about during the beta that the time variable type was great but it wasn't well implemented and their are all kinds of holes in it. This is a prime example. But I think many could be worked around if I could take a date and time string of text and convert it to decimal Delphi time. Personally I think it should be a function in MEP but ISS didn't agree to I've resolved to write a macro to do just this. Time is easy and I already have a routine that counts days of a year based on month and day that even work with all the leap day rules so now I just need a year calculator. I came up with a basic algorithm that would work from 1900 on but now I've decided I want it to work for all times sake so I'm making some slight adjustments to the logic to work with the 4, 100, and 400 leap day rules in both positive and negative from 1900. So now we all will be able to take dates in all kinds of ways and shoehorn them into MEP time vars. I think I'll also formalize my day of the week routine and weekday test. Eventually I might even do holidays. I wish this was all in MEP but now that it's apparent it will not be I'll pick up the flag. It just bums me out a little because I bet there are some functions in Delphi that would be a lot more simple. Too bad I couldn't make a few bucks off these functions. Quote Link to comment Share on other sites More sharing options...
joe Posted January 26, 2009 Report Share Posted January 26, 2009 I want a date variable set from one of the dates of a file. Like Variable Set From File - Get File Date/Time and Ive decided it doesn't exist. Cory I'm confused. Isn't getting the date and time from a file exactly what the Variable Set From File does? What point am I missing? Quote Link to comment Share on other sites More sharing options...
Cory Posted January 26, 2009 Author Report Share Posted January 26, 2009 Correct, it does. But it saves it to a collection of string varables, not TIME variables. Quote Link to comment Share on other sites More sharing options...
floyd Posted January 26, 2009 Report Share Posted January 26, 2009 Correct, it does. But it saves it to a collection of string varables, not TIME variables. So you're saying you need the datetime stamp of a file to be presented to you as a MX Pro decimal value so you can use the Convert Decimal to Date/Time command? Which stamp: created, modified, or accessed? Quote Link to comment Share on other sites More sharing options...
Cory Posted January 26, 2009 Author Report Share Posted January 26, 2009 Yes. More technically I wish MEP would have a drop-down option to directly save the date stamp to a time variable. And at the moment I want the creation time but in other instance I will certainly need the others. But the thing is we need this for many different places. What we need is a Variable Modify String > Convert to Decimal Time. Let's say you grab data off a web page harvest or something that has a string date. Well if we want that to work with the time variables we're hosed at the moment. So I've started writing a macro that will parse a variety of standard date and time formats into year, month, day, hour, minute, second and calculate the decimal time. My fisrt algorithm was fatally flawed for extreme dates but I think I know a solution now. Quote Link to comment Share on other sites More sharing options...
kevin Posted January 27, 2009 Report Share Posted January 27, 2009 The request 'Add an option to Variable Set From File to save Date/Time into a DateTime variable' has been added to our tracking system and assigned the tracking number [iSS6494]. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.