How to shift "Date Created" property of a file by a given number of days and hours? - vba

I am looking for a solution how to change file's property "Date Created". Preferably in VBA since it is the only programming language I more or less able to code with.
I have hundreds of photos taken from my last vacations. And I have noticed that date in my camera settings is wrong. It is set to be December 2014. So the real date on all pictures is shifted back by 216 days, 16 hours and 25 minutes.
How can I possibly open all pictures in a given directory one by one and change "Date Created" property by given number of days and hours? Any hints, please?

There are freeware tools that can help you with this task, but if you want to do it for fun, you can achive this by importing SetFileTime in your VBA code and then call it for each file in your directory.
To get started, you can find an example here

Related

I can't modify my store opening hours on prestashop 1.6.1.10

my problem is that when I edit the opening hours of one of my stores (preferences > store contacts > and then modify one of my 5 stores) something goes wrong. I want my shop to stay open from Monday to Saturday in these hours 09.00 - 12.30; 15.30 - 19.30, but for some reason in the Saturday field I can write only these hours 09.00 - 12.30 because if in this day I write also 15.30 - 19.30 prestashop deletes every other hour of every other day (after I clicked save, I go back and all the fields of all the days are empty; ).
How can I solve it? Are there some time limitations I am not aware of?
see the images if you don't understand just ask again
Thanks
Lorenzo
it doesn't work
it works just fine
Unfortunately, the field in database for the store hours is varchar 254, and encodes all hours in the same field with serialize. It's not related to all the time being equal, but it you use less chars in each field it will allow you to same it correctly. Or, if you have access to the database, you can increase the field 'hours' in table '__DB_PREFIX__store' to greater than 254.
In version 1.7 it uses json_encode, it's smaller, but cant use a field like '09.00 - 12.30; 15.30 - 19.30; 20:30 - 23:30' and no warning is issued.

How do you get the ticket created date in trac?

I want to play with some really simple queries for a report, but I want to group everything by the creation date. The problem I am having is that time exists in the database, but not the date. From searching around in trac-related resources, it looks like I need to install trac.util.datefmt to be able to extract this information from datetime(time). I can find the API documentation for trac.util.datefmt, but not a download link to get the .egg.
Am I going in the right direction? If I can do what I need (i.e. get the creation month/day/year) without a plugin, what column do I use? I don't see anything else in the schema that is reasonable. If I do need trac.util.datefmt, where do I download it from? And if I really need a different plugin, which one should I be using?
I'll assume Trac >= 1.0. The time column is unix epoch time: the number of seconds that have elapsed since January 1st 1970. You can divide the value by 1e6 and put the value in a converter to see an example of extracting the datetime from the time column. trac.util.datefmt is part of the egg that ships with Trac, but since you are working with reports it doesn't sound like you need to know more about that function to accomplish your aim.
In a Trac report the time column will be automatically formatted as a date. You can look at the default report {1} as an example. I'm not sure how you intend to group by creation date. Do you wish to group tickets created in a certain datetime range?

Excel - VBA - Access: Date Selection Solution

I'm looking for a direction, assuming that surely someone has had to do something similar and I'm making this more difficult than it is.
We have an Access DB, feeds to a pivot table in Excel, which is in turn used to supply charts for a "user dashboard." This is 2010, so no slicers.
My problem is that that DB is updated adding months to a field. There is a listbox in the dashboard that will allow the user to select a specific month and see stats for that time. I'm having a couple problems even getting started and would like to make sure I'm going about this the simplist/most efficient way.
My thought was to populate the listbox with the 'month' fields from the pivot table. I'm not quite sure how I'm going to do that with VBA (I have a couple ideas), but if that's the best route then I'll figure it out.
But, has anyone had a similar need, and found a better solution? I have a bunch of buttons to handle other fields, but I would really like to allow for the user to select a date/month/range...whatever. Surely this is a common, easily managed desire, no?
I'd put this in with the conversation you're having with a couple of people above, but I don't have enough rep to do that yet.
I had a similar dashboard issue years ago. Resolved it by adding a dropdown beside the month box (which was a dropdown in my case, not a listbox) with the options "Year to date" and "Month to date". By definition selecting a past month and MTD gave you the whole month, whereas selecting the current month can only ever give you MTD. Same thing with YTD - it would give you the combined stats for the current year to date instead of just one month.
The month dropdown in my dashboard was populated based on the current data in the pivot, which in turn was controlled from the database. We used a 25-month rolling select for the data and showed only the last 13 months in the month dropdown. That gave us a full 12 month spread of historical data to work from if someone chose the oldest month we offered them, yet kept the size of the pivot cache manageable
I used a dropdown for the options instead of option buttons or a checkbox, because I had a suspicion that delivering what was asked for would lead to additional requests. I was right. Eventually we had options for "Last year to date" (how we were tracking this day last year), "Quarter to date", "Financial year to date", and so on. Adding extra choices to the dropdown box was easier than rearranging the dashboard to accommodate the proliferating requirements.

automatically renewing records when the last day of year

I'm developing a c# application that consists of Document Incoming System for my police station.
In this system, variable document's contents are been saved to an SQL database. I must give them a "Document Number".
I'm achieving all of these, but i want that every years last day such as 31.12.2014, the numbers that have been given to a document like "2145" will turn to "1" at the the first day of year 01.01.2015.
So, the records must be 2014/2145. and the last days of years turns to 2015/1.
How can I achieve this?
You count the existing documents for the same year, then add one.
So if you want to store a document that belongs to 2013, you first count how many existing documents you have in 2013, then add one.
I can't write the sql for you, because you haven't described the data structure, but it should be simple enough using SQL COUNT, and DATEPART to retrieve only the year from a date field.

Access 97: table entry to drop off form when a date/time reached

I like to think i'm not completely useless at creating MS Access databases, but i'm definitely a failure at the SQL code side.. So as a result i'm not sure whether this is a stupid question or not!
At work i'm trying to add a "news feed" type thing to a Form on the front screen of a database used to find useful information stored in various places. At the moment my workplace is using Office 2007, but Access is the 97 version!!!! As they're only recently realizing it can be used to solve a few of their problems... we're expecting to upgrade the whole of office and access to 2010 soon.
On this database (created using access 97..) there is a "refresh" type button which simply closes and re-opens the form and thus shows the latest info entered onto the "news feed", and this also shows the current time and date. What i'd like to happen is have specific entries drop off after a period of time (which probably wont happen unless refreshed), so for example an entry will have been added regarding some server ammendments being made within the workplace so "certain systems will not be working between 8am and 5pm GMT on 9/1/12" and preferably the person who created this entry could enter a date into the form 24 hours, or even a few days, later and when this date is reached the entry would disappear. I understand this is something that may be achieved using a query but i have no idea where to start.
If anyone can help give me an idea of how to do this it would be greatly appreciated.
I apologise if this is poorly worded or not completely clear, i can elaborate if questions are asked.
many thanks,
Kris
You can make a query like this to return only the entries that are less than 3 days old:
SELECT *
FROM MyTable
WHERE CreateTime > DateAdd("d", -3, Now())
In your form, you can define a timer interval and a timer event handler (see the "Event" tab on the properties window). You could use it to requery your list (Me!lstNews.Requery).
In the table you can define the column "CreateTime" as data type "Date/Time" and define its default value as =Now(). This way no text box is required to enter this data.
EDIT:
How to configure the timer in an Access Form (time is in milliseconds):