See the reference documentation for the String class: String s = String.valueOf(date);
If your Long might be null and you don't want to get a 4-letter "null" string, you might use Objects.toString, like: String s = Objects.toString(date, null);
EDIT:
You reverse it using Long l = Long.valueOf(s); but in this direction you need to catch NumberFormatException
java - How to convert / cast long to String? - Stack Overflow
How to converte String to Long? - Products - Jaspersoft Community
How to convert String to long in Java? - Stack Overflow
[Java] How can I convert a string of long text into IPA?
Is there any difference between converting string to long and int in Java?
Can I convert strings with commas like "1,000" to long in Java?
What’s the safest way to convert string to long in Java when the value might be wrong?
Videos
See the reference documentation for the String class: String s = String.valueOf(date);
If your Long might be null and you don't want to get a 4-letter "null" string, you might use Objects.toString, like: String s = Objects.toString(date, null);
EDIT:
You reverse it using Long l = Long.valueOf(s); but in this direction you need to catch NumberFormatException
String strLong = Long.toString(longNumber);
Simple and works fine :-)
Use Long.parseLong()
Copy Long.parseLong("0", 10) // returns 0L
Long.parseLong("473", 10) // returns 473L
Long.parseLong("-0", 10) // returns 0L
Long.parseLong("-FF", 16) // returns -255L
Long.parseLong("1100110", 2) // returns 102L
Long.parseLong("99", 8) // throws a NumberFormatException
Long.parseLong("Hazelnut", 10) // throws a NumberFormatException
Long.parseLong("Hazelnut", 36) // returns 1356099454469L
Long.parseLong("999") // returns 999L
To convert a String to a Long (object), use Long.valueOf(String s).longValue();
See link