Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[IMPROVEMENT] Convert UTC to time #2077

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

VANKINEENITAWRUN
Copy link
Contributor

@RocketChat/android

Closes #2046

Changes: [converted the given UTC offset to time.]

Screenshots or GIF for the change:

screenshot_2019-03-01-18-50-18-0142737436

@CLAassistant
Copy link

CLAassistant commented Mar 1, 2019

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@philipbrito philipbrito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this PR and closing the existent TODO here! But I think you could work with the Java 8 Date/Time API.

@philipbrito philipbrito changed the title convert UTC to Time [NEW] Convert UTC to time Mar 4, 2019
@philipbrito philipbrito changed the title [NEW] Convert UTC to time [IMPROVEMENT] Convert UTC to time Mar 4, 2019
@philipbrito philipbrito added this to the 3.3.0 milestone Mar 4, 2019
Copy link
Contributor

@philipbrito philipbrito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a function on DateTimeHelper class to convert UTC to Time.

@philipbrito
Copy link
Contributor

@VANKINEENITAWRUN Could you please sign in our CLA?

@VANKINEENITAWRUN
Copy link
Contributor Author

VANKINEENITAWRUN commented Mar 6, 2019

I did @filipedelimabrito it's still pending.


fun utcToTime(utcOffset:Float?): String {
val gmtTime = System.currentTimeMillis() // 2.32pm NZDT
var timezoneAlteredTime: Long
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could Lift out the assignment timeZoneAlteredTime. Directly could
timeZoneAlteredTime = if (condition ) value else other value.
This would be according to Kotlin Coding style :)

@rafaelks rafaelks removed this from the 3.3.0 milestone May 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] TimeZone is app is showed wrong.
5 participants