* Restoring Settings to New OS Build
- tatewise
- Megastar
- Posts: 27080
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Restoring Settings to New OS Build
I've looked at that and it sounds promising but there are almost no example scripts and so I have no idea what Lua commands would be needed to implement that DATE conversion feature.
What luacom.CreateObject("...") statement is required? What are the conversion methods/functions available?
What luacom.CreateObject("...") statement is required? What are the conversion methods/functions available?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- ColeValleyGirl
- Megastar
- Posts: 4853
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Restoring Settings to New OS Build
Once you've required luacom, it becomes a table. So use
and
The table option returns something like:
Code: Select all
luacom.DateFormat = "table"Code: Select all
luacom.DateFormat = "string"Code: Select all
modified => (table .8)
Hour => 16
Second => 10
DayOfWeek => 0
Month => 12
Minute => 59
Milliseconds => 0
Year => 2021
Day => 12Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- tatewise
- Megastar
- Posts: 27080
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Restoring Settings to New OS Build
Ah! The penny has dropped
This is the default that I was struggling with:
This converts to a fixed format table regardless of the locale settings:
Then intTime is the UNIX epoch seconds since 01/01/1970 
Thank you Helen.
This is the default that I was struggling with:
Code: Select all
luacom.DateFormat = "string" -- this is the default
fileObj = fhFileUtils.fso:GetFile(strFilePath)
strMod = fileObj.DateLastModified -- returns such as "30/3/2022 10:22:14 PM" depending on locale
Code: Select all
luacom.DateFormat = "table"
fileObj = fhFileUtils.fso:GetFile(strFilePath)
dicMod = fileObj.DateLastModified -- returns standard format table
intTime = os.time({ year=dicMod.Year; month=dicMod.Month; day=dicMod.Day; hour=dicMod.Hour; min=dicMod.Minute; sec=dicMod.Second; })
Thank you Helen.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- tatewise
- Megastar
- Posts: 27080
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Restoring Settings to New OS Build
The attached Backup and Restore Family Historian Settings plugin Version 3.3.3 Date 31 Mar 22 uses that new technique that should cope with all local date-time formats without altering the Windows Registry.
It has the side benefit of showing date-times in messages using the current user's local format settings.
It has the side benefit of showing date-times in messages using the current user's local format settings.
Last edited by tatewise on 01 Apr 2022 10:30, edited 1 time in total.
Reason: Attachment deleted as later version is in the Plugin Store.
Reason: Attachment deleted as later version is in the Plugin Store.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- NickWalker
- Megastar
- Posts: 2401
- Joined: 02 Jan 2004 17:39
- Family Historian: V7
- Location: Lancashire, UK
- Contact:
Re: Restoring Settings to New OS Build
I like it when a plan comes together. You and Helen make a great team 
- ColeValleyGirl
- Megastar
- Posts: 4853
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Restoring Settings to New OS Build
I've run a Backup with the old & new version, and it seems to be identical apart from system files, and apart from the map cache, it also matches the Windows version
Colin McDonald - Researching McDonald, McGillivray, Tait, Rountree families
- tatewise
- Megastar
- Posts: 27080
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Restoring Settings to New OS Build
Backup and Restore Family Historian Settings plugin Version 3.4 Date 31 Mar 22 is now in the Plugin Store
I think there needs to be a KB Snippet for the code that solved this problem with related code that provides substitute values for the LuaFileSystem Attributes such as mode, access, modification, change, size, etc. I'll add it to my list
I think there needs to be a KB Snippet for the code that solved this problem with related code that provides substitute values for the LuaFileSystem Attributes such as mode, access, modification, change, size, etc. I'll add it to my list
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry