Macro Express Forums: Set Date/Time variable from file - Macro Express Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Set Date/Time variable from file

#1 User is offline   Cory 

  • Master
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,561
  • Joined: 17-February 05
  • Gender:Male
  • Location:Fallbrook, CA
  • Interests:Making money by helping people save money!

Posted 24 January 2009 - 06:20 PM

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?
Cory Jackson
Fallbrook, California
Bluepoint Design
Macro writer for hire! Need help with a macro fast? Just contact me.
0

#2 User is offline   joe 

  • Master
  • PipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 1,088
  • Joined: 04-July 04
  • Gender:Male

Posted 24 January 2009 - 10:36 PM

View PostCory, on Jan 24 2009, 06:20 PM, said:

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"?
0

#3 User is offline   Cory 

  • Master
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,561
  • Joined: 17-February 05
  • Gender:Male
  • Location:Fallbrook, CA
  • Interests:Making money by helping people save money!

Posted 25 January 2009 - 03:56 PM

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.
Cory Jackson
Fallbrook, California
Bluepoint Design
Macro writer for hire! Need help with a macro fast? Just contact me.
0

#4 User is offline   joe 

  • Master
  • PipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 1,088
  • Joined: 04-July 04
  • Gender:Male

Posted 26 January 2009 - 12:47 AM

View PostCory, on Jan 25 2009, 03:56 PM, said:

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?
0

#5 User is offline   Cory 

  • Master
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,561
  • Joined: 17-February 05
  • Gender:Male
  • Location:Fallbrook, CA
  • Interests:Making money by helping people save money!

Posted 26 January 2009 - 12:14 PM

Correct, it does. But it saves it to a collection of string varables, not TIME variables.
Cory Jackson
Fallbrook, California
Bluepoint Design
Macro writer for hire! Need help with a macro fast? Just contact me.
0

#6 User is offline   floyd 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 359
  • Joined: 03-July 04

Posted 26 January 2009 - 05:43 PM

View PostCory, on Jan 26 2009, 12:14 PM, said:

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?
0

#7 User is offline   Cory 

  • Master
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,561
  • Joined: 17-February 05
  • Gender:Male
  • Location:Fallbrook, CA
  • Interests:Making money by helping people save money!

Posted 26 January 2009 - 06:57 PM

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.
Cory Jackson
Fallbrook, California
Bluepoint Design
Macro writer for hire! Need help with a macro fast? Just contact me.
0

#8 User is offline   kevin 

  • Master
  • PipPipPipPipPipPipPip
  • Group: Admin
  • Posts: 1,989
  • Joined: 04-July 04
  • Gender:Male

Posted 27 January 2009 - 06:04 PM

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].
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic