Thread: Time Stamps in chat

Results 1 to 7 of 7
  1. #1 Time Stamps in chat 


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000


    Code:
        public static String getTime() {
            Calendar calendar = new GregorianCalendar();
            String meridiem;
            int hour = calendar.get(Calendar.HOUR);
            int minute = calendar.get(Calendar.MINUTE);
            meridiem = calendar.get(Calendar.AM_PM) == 0 ? "AM" : "PM";
            return "[" + hour + ":" + minute + " " + meridiem + "]";
        }
    compare&replace
    Code:
    if ((chatType == 1 || chatType == 2)
                                && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
                            if (chatTypeView == 1 || chatTypeView == 0) {
                                int xPos = 11;
                                if (Configuration.enableTimeStamps) {
                                    newRegularFont.drawBasicString(timeStamp, xPos, yPos + yOffset,
                                            changeChatArea ? 0xFFFFFF : 0, shadow);
                                    xPos += newRegularFont.getTextWidth(timeStamp);
                                }
                                if (playerRights >= 1) {
                                    modIcons[playerRights - 1].drawSprite(xPos, yPos - 12 + yOffset);
                                    xPos += 16;
                                }
                                newRegularFont.drawBasicString(title + s1 + ":", xPos - 3, yPos + yOffset,
                                        changeChatArea ? 0xFFFFFF : 0, shadow);
                                xPos += newRegularFont.getTextWidth(title + s1) + 8;
                                newRegularFont.drawBasicString(" " + chatMessages[k], xPos - 8, yPos + yOffset,
                                        changeChatArea ? 0x7FA9FF : 255, shadow);
                                j++;
                                j77++;
                            }
                        }
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2011
    Posts
    1,904
    Thanks given
    367
    Thanks received
    330
    Rep Power
    0
    Thanks for this!
    Reply With Quote  
     

  3. #3  
    Rune-Server Affiliate

    Join Date
    Apr 2014
    Posts
    1,761
    Thanks given
    75
    Thanks received
    714
    Rep Power
    1073
    i think galkon had this in his runelimited client
    Reply With Quote  
     

  4. Thankful user:


  5. #4  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    Quote Originally Posted by Zion View Post
    i think galkon had this in his runelimited client
    I think so, but not where this op post came from though.
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  6. #5  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Thanks for the share
    Reply With Quote  
     

  7. #6  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Code:
    private final LocalTimeStringConverter converter = new LocalTimeStringConverter(FormatStyle.SHORT);
    
    String getTime() {
        return converter.toString(LocalTime.now());
    }
    Doesn't need to be anything more than that. It would return X:XX AM or X:XX PM because of the parameter FormatStyle.SHORT. None the less, good job.
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    Retired. Stop PMing me.


    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    17
    Posts
    7,526
    Thanks given
    1,805
    Thanks received
    2,830
    Rep Power
    5000
    Ripped straight from old clients lmao
    Attached image
    Reply With Quote  
     



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Logging Date and Time (Useful for Chat, PM's etc.)
    By Simbioitic in forum Snippets
    Replies: 6
    Last Post: 04-28-2009, 02:12 PM
  2. 70 Times Stabbed in Rotterdam(Holland)
    By Koâk in forum Videos
    Replies: 18
    Last Post: 04-01-2009, 07:17 PM
  3. Changing the (arterisk) * In Chat And others
    By mr smith in forum Tutorials
    Replies: 7
    Last Post: 01-19-2009, 09:56 PM
  4. Replies: 1
    Last Post: 11-01-2008, 10:19 AM
  5. Total Time Online (in minutes)
    By Evil in forum Tutorials
    Replies: 8
    Last Post: 10-26-2008, 02:48 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •