mirror of
https://github.com/tjboldt/ProDOS-Utilities.git
synced 2024-11-24 16:31:28 +00:00
Fix DateTimeFromProDOS and tests
This commit is contained in:
parent
c17bfa0b4d
commit
1cbb9fa0d9
@ -20,7 +20,7 @@ func TestCreateVolume(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
testname := fmt.Sprintf("%d", tt.blocks)
|
||||
t.Run(testname, func(t *testing.T) {
|
||||
fileName := os.TempDir() + "test-volume.hdv"
|
||||
fileName := os.TempDir() + "/test-volume.hdv"
|
||||
defer os.Remove(fileName)
|
||||
file, err := os.Create(fileName)
|
||||
if err != nil {
|
||||
|
@ -50,7 +50,7 @@ func DateTimeFromProDOS(buffer []byte) time.Time {
|
||||
year = 1900 + int(twoDigitYear)
|
||||
}
|
||||
|
||||
month := int(buffer[0]>>5 + buffer[1]&1)
|
||||
month := int(buffer[0]>>5 + (buffer[1]&1)<<3)
|
||||
day := int(buffer[0] & 31)
|
||||
hour := int(buffer[3])
|
||||
minute := int(buffer[2])
|
||||
|
Loading…
Reference in New Issue
Block a user