Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
import java.util.Locale
import java.util.TimeZone
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicInteger

Expand Down Expand Up @@ -272,7 +271,7 @@ class ArchiveFileSystem private constructor(private val context: Context, root:
* Attempt to create a [SnapshotFileSystem] to represent a single backup snapshot.
*/
fun createSnapshot(): SnapshotFileSystem? {
val timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US).apply { timeZone = TimeZone.getTimeZone("UTC") }.format(Date())
val timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US).format(Date())
val snapshotDirectoryName = "${BACKUP_DIRECTORY_PREFIX}-$timestamp"

if (signalBackups.hasFile(snapshotDirectoryName)) {
Expand Down Expand Up @@ -529,7 +528,7 @@ private fun String.toMilliseconds(): Long {

if (parts.size == 7) {
try {
val calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US)
val calendar = Calendar.getInstance(Locale.US)
calendar[Calendar.YEAR] = parts[1].toInt()
calendar[Calendar.MONTH] = parts[2].toInt() - 1
calendar[Calendar.DAY_OF_MONTH] = parts[3].toInt()
Expand Down