Comments (15)
Does not work, most likely because of locale settings.
PS C:\Users\xx> $s = [Datetime]"28/06/2000 12:00:00 pm"
Der Wert "28/06/2000 12:00:00 pm" kann nicht in den Typ "System.DateTime" konvertiert werden. Fehler: "Die
Zeichenfolge wurde nicht als gültiges DateTime erkannt."
In Zeile:1 Zeichen:1
+ $s = [Datetime]"28/06/2000 12:00:00 pm"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocationWithFormatProvider
from diablo2rloader.
I've done a slightly different approach, this time specifying how to read the data as well as how to output it.
Can please ask you to test this for me before I release this?
Please test by downloading the updated PS1 file and copy over your existing one. You won't have to edit stats.csv.
https://github.com/shupershuff/Diablo2RLoader/blob/main/D2Loader.ps1
from diablo2rloader.
Ha I was just looking at this as I was still getting an error. I thought I'd try to fix it myself. Tried to push and saw you fixed it too! I did it really similarly
$CurrentStats.LastUpdateCheck = get-date -Format "dd/MM/yyyy hh:mm:ss"
removed the pm
where it's written.
from diablo2rloader.
Now it looks like in picture 2. thx
from diablo2rloader.
Gutentag!
Yes the issue was the time variable couldn't be converted if DD was a single digit.
Meaning if you ran it on the 1st through to the 9th of the month it would crap out. This breaks the update checker. Pretty annoying and not something I tested for before releasing.
Fix is to either manually update to latest version or open stats.csv and delete the value for LastUpdateCheck.
Also covered off here: #15
I'll put a note on the readme page too.
from diablo2rloader.
Hello,
thanks for the quick response. I still have the issue with 1.83
What happens if you test the part from screenshot 2 in your powershell console?
BR
from diablo2rloader.
These two variants would work on my machine. Maybe you can try on yours too.
Edit: it breaks the if clause somehow..
[datetime]::ParseExact('3/6/2000 12:00:00 PM','d/M/yyyy h:mm:ss tt', [cultureinfo]::InvariantCulture)
Samstag, 3. Juni 2000 12:00:00
[datetime]::ParseExact('03/06/2000 12:00:00 PM','d/M/yyyy h:mm:ss tt', [cultureinfo]::InvariantCulture)
Samstag, 3. Juni 2000 12:00:00
Edit2:
Maybe it is possible to save the date in another format something like:
(Get-Date -Year 2000 -Month 12 -Day 31).ToUniversalTime().ToString('yyyyMMddTHHmmss')
20001231T195700
and compare it with
(Get-Date).addHours(-8).ToUniversalTime().ToString('yyyyMMddTHHmmss')
20230831T105811
from diablo2rloader.
Hello,
thanks for the quick response. I still have the issue with 1.83
What happens if you test the part from screenshot 2 in your powershell console?
BR
I tried the below which worked fine for me:
$s = "28/06/2000 12:00:00 pm"
[DateTime]::ParseExact($s, "dd/MM/yyyy h:mm:ss tt", $null);
I suspect the issue is with having different region settings. What do your date settings look like? Mine look like this. I might use your suggestion with Universal time.
from diablo2rloader.
@bmml1 Can you test this for me:
$s = [Datetime]"28/06/2000 12:00:00 pm"
[DateTime]::ParseExact($s, "dd/MM/yyyy h:mm:ss tt", $null);
from diablo2rloader.
Thanks, I'll try and update the script tonight to use a universal time format.
from diablo2rloader.
Works like a charm. Thx :)
from diablo2rloader.
I made a couple other slight changes prior to release but it's functionally the same.
Thanks for raising this and thanks for your input.
from diablo2rloader.
@bmml1 have you had any issues the hours played display showing incorrectly? Wondering if there's another regional issue.
Just had another German based person note that the display shows incorrectly (possibly minutes showing as hours):
from diablo2rloader.
Yep, looks like in the first picture.
from diablo2rloader.
I've drafted a small update to resolve that issue. If you like you can test it:
https://github.com/shupershuff/Diablo2RLoader/blob/main/D2Loader.ps1
from diablo2rloader.
Related Issues (20)
- Is there a set way to open a windowed account on a specific spot? HOT 1
- Issue with windows 11? HOT 13
- Feature Idea, Voice Alarms for DClone HOT 3
- Function to kill open handles HOT 3
- Doesn't work on Asia server HOT 2
- Issues with the Asia server HOT 6
- Issue switching to any realm besides NA HOT 11
- Issue with Region display HOT 1
- Tune up ingame settings.json a little bit. HOT 12
- One of the game windows close after switching back and forth between window HOT 10
- How to kill a cow king? HOT 1
- TZ and Dclone updates fail with d2emu.com HOT 2
- Is this out of date? HOT 3
- Unable to connect to battle net HOT 10
- Error page to get token doesn't work; here's an alternative HOT 9
- Accounts.csv has duplicate IDs HOT 2
- [Feature request] Default region per-account in Account.csv HOT 3
- [Bug] D2Emu terror zone fetching is not working. HOT 7
- [Bug] DClone status errors out from D2Emu HOT 2
- [Feature Request] Add setting to skip 'press any key to continue' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diablo2rloader.