Unity/Firestore

Timestamp

lipnus 2021. 7. 10. 17:05
반응형

Timestamp 등록

날짜는 필수, 시간은 입력안하면 0:00

 

 

Timestamp 등록

DocumentReference cityRef = db.Collection("cities").Document("new-city-id");
cityRef.UpdateAsync("Timestamp", FieldValue.ServerTimestamp)
        .ContinueWithOnMainThread(task => {
                Debug.Log(
                        "Updated the Timestamp field of the new-city-id document in the cities "
                        + "collection.");
        });

서버시간을 바로 Timestamp에 대입함. 근데 이건 Update할때이고..

 

 

Timestamp???

왜 Unity예제코드에는 Timestamp가 없다?

시발?

 

자바는 이렇게 하면 됨..

docData.put("dateExample", new Timestamp(new Date()));

 

 

 

Cloud Firestore에 데이터 추가  |  Firebase

다음과 같은 몇 가지 방법으로 Cloud Firestore에 데이터를 쓸 수 있습니다. 문서 식별자를 명시적으로 지정하여 컬렉션 내의 문서 데이터를 설정합니다. 컬렉션에 새 문서를 추가합니다. 이 경우 Clo

firebase.google.cn

 

반응형

'Unity > Firestore' 카테고리의 다른 글

Firebase의 숫자값은 Long?  (0) 2024.03.17
Google Cloud Storage 경로를 CDN처럼 깔끔하게 구현  (0) 2022.01.28